![]() |
HttpDebugSocket.hGo to the documentation of this file.00001 00004 /* 00005 Copyright (C) 2004-2011 Anders Hedstrom (grymse@alhem.net) 00006 00007 This library is made available under the terms of the GNU GPL, with 00008 the additional exemption that compiling, linking, and/or using OpenSSL 00009 is allowed. 00010 00011 If you would like to use this library in a closed-source application, 00012 a separate license agreement is available. For information about 00013 the closed-source license agreement for the C++ sockets library, 00014 please visit http://www.alhem.net/Sockets/license.html and/or 00015 email license@alhem.net. 00016 00017 This program is free software; you can redistribute it and/or 00018 modify it under the terms of the GNU General Public License 00019 as published by the Free Software Foundation; either version 2 00020 of the License, or (at your option) any later version. 00021 00022 This program is distributed in the hope that it will be useful, 00023 but WITHOUT ANY WARRANTY; without even the implied warranty of 00024 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00025 GNU General Public License for more details. 00026 00027 You should have received a copy of the GNU General Public License 00028 along with this program; if not, write to the Free Software 00029 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00030 */ 00031 #ifndef _SOCKETS_HttpDebugSocket_H 00032 #define _SOCKETS_HttpDebugSocket_H 00033 00034 #include "sockets-config.h" 00035 #include "HTTPSocket.h" 00036 00037 #ifdef SOCKETS_NAMESPACE 00038 namespace SOCKETS_NAMESPACE { 00039 #endif 00040 00041 class ISocketHandler; 00042 00046 class HttpDebugSocket : public HTTPSocket 00047 { 00048 public: 00049 HttpDebugSocket(ISocketHandler&); 00050 ~HttpDebugSocket(); 00051 00052 void Init(); 00053 00054 void OnFirst(); 00055 void OnHeader(const std::string& key,const std::string& value); 00056 void OnHeaderComplete(); 00057 void OnData(const char *,size_t); 00058 void OnDataComplete(); 00059 00060 private: 00061 HttpDebugSocket(const HttpDebugSocket& s) : HTTPSocket(s) {} // copy constructor 00062 HttpDebugSocket& operator=(const HttpDebugSocket& ) { return *this; } // assignment operator 00063 int m_content_length; 00064 int m_read_ptr; 00065 }; 00066 00067 00068 #ifdef SOCKETS_NAMESPACE 00069 } 00070 #endif 00071 00072 #endif // _SOCKETS_HttpDebugSocket_H 00073 |