Name of changed file | |
| Version and , file | Version and , file |
| Line 1 in | Line 1 in |
Context line Removed line Changed line Context line | Context line Changed line Added line Context line |
Base64.h | |
| /usr/src/Sockets-2.1.3/Base64.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/Base64.h Thu May 10, 2007 |
| Line 28 in Base64.h | Line 28 in Base64.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _BASE64_H #define _BASE64_H #ifdef _WIN32 #pragma warning(disable:4514) | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Base64_H #define _SOCKETS_Base64_H #include "sockets-config.h" #ifdef _WIN32 #pragma warning(disable:4514) |
| Line 72 in Base64.h | Line 73 in Base64.h |
#endif #endif // _BASE64_H | #endif #endif // _SOCKETS_Base64_H |
CTcpSocket.h | |
| /usr/src/Sockets-2.1.3/CTcpSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/CTcpSocket.h Thu May 10, 2007 |
| Line 28 in CTcpSocket.h | Line 28 in CTcpSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _CTCPSOCKET_H #define _CTCPSOCKET_H #include "TcpSocket.h" #include "ICrypt.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_CTcpSocket_H #define _SOCKETS_CTcpSocket_H #include "sockets-config.h" #include "TcpSocket.h" #include "ICrypt.h" |
| Line 68 in CTcpSocket.h | Line 69 in CTcpSocket.h |
#endif #endif // _CTCPSOCKET_H | #endif #endif // _SOCKETS_CTcpSocket_H |
CircularBuffer.h | |
| /usr/src/Sockets-2.1.3/CircularBuffer.h Sat Apr 21, 2007 | /usr/src/Sockets-2.1.4/CircularBuffer.h Thu May 10, 2007 |
| Line 28 in CircularBuffer.h | Line 28 in CircularBuffer.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _CIRCULARBUFFER_H #define _CIRCULARBUFFER_H #include <string> | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_CircularBuffer_H #define _SOCKETS_CircularBuffer_H #include "sockets-config.h" #include <string> |
| Line 91 in CircularBuffer.h | Line 92 in CircularBuffer.h |
#endif // _CIRCULARBUFFER_H | #endif // _SOCKETS_CircularBuffer_H |
Event.h | |
| /usr/src/Sockets-2.1.3/Event.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/Event.h Thu May 10, 2007 |
| Line 28 in Event.h | Line 28 in Event.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _EVENT_H #define _EVENT_H #ifdef _WIN32 #else | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Event_H #define _SOCKETS_Event_H #include "sockets-config.h" #ifdef _WIN32 #else |
| Line 72 in Event.h | Line 73 in Event.h |
#endif #endif // _EVENT_H | #endif #endif // _SOCKETS_Event_H |
EventHandler.cpp | |
| /usr/src/Sockets-2.1.3/EventHandler.cpp Sat Apr 21, 2007 | /usr/src/Sockets-2.1.4/EventHandler.cpp Thu May 10, 2007 |
| Line 35 in EventHandler.cpp | Line 35 in EventHandler.cpp |
#include "Event.h" #include "Socket.h" #include "EventSocket.h" #include "ListenSocket.h" | #include "Event.h" #include "Socket.h" #include "TcpSocket.h" #include "ListenSocket.h" |
| Line 60 in EventHandler.cpp | Line 60 in EventHandler.cpp |
std::list<Event *>::iterator it = m_events.begin(); Event *e = *it; e -> GetFrom() -> SetHandlerInvalid(); delete e; m_events.erase(it); | |
| Line 75 in EventHandler.cpp | Line 76 in EventHandler.cpp |
EventTime now; mytime_t diff = (*it) -> GetTime() - now; if (diff < 1) { diff = 1; } tv -> tv_sec = static_cast<long>(diff / 1000000); tv -> tv_usec = static_cast<long>(diff % 1000000); | |
| Line 99 in EventHandler.cpp | Line 104 in EventHandler.cpp |
{ e -> GetFrom() -> OnEvent(e -> GetID()); e -> GetFrom() -> Decrease(); } delete e; | |
| Line 120 in EventHandler.cpp | Line 126 in EventHandler.cpp |
m_socket -> Send("\n"); } from -> Increase(); return e -> GetID(); } | |
| Line 138 in EventHandler.cpp | Line 145 in EventHandler.cpp |
m_events.erase(it); repeat = true; from -> Decrease(); break; } | |
| Line 188 in EventHandler.cpp | Line 196 in EventHandler.cpp |
if (!m_socket) { ListenSocket<EventSocket> *l = new ListenSocket<EventSocket>(*this); l -> SetDeleteByHandler(); l -> Bind("127.0.0.1", 0); m_port = l -> GetPort(); SocketHandler::Add(l); m_socket = new EventSocket( *this ); m_socket -> SetDeleteByHandler(); m_socket -> SetConnectTimeout(5); | if (!m_socket) { ListenSocket<TcpSocket> *l = new ListenSocket<TcpSocket>(*this); l -> SetDeleteByHandler(); l -> Bind("127.0.0.1", 0); m_port = l -> GetPort(); SocketHandler::Add(l); m_socket = new TcpSocket( *this ); m_socket -> SetDeleteByHandler(); m_socket -> SetConnectTimeout(5); |
EventHandler.h | |
| /usr/src/Sockets-2.1.3/EventHandler.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/EventHandler.h Thu May 10, 2007 |
| Line 28 in EventHandler.h | Line 28 in EventHandler.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _EVENTHANDLER_H #define _EVENTHANDLER_H #include "SocketHandler.h" #include "IEventHandler.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_EventHandler_H #define _SOCKETS_EventHandler_H #include "sockets-config.h" #include "SocketHandler.h" #include "IEventHandler.h" |
| Line 42 in EventHandler.h | Line 43 in EventHandler.h |
class IEventOwner; class Event; class EventSocket; /** SocketHandler implementing the IEventHandler interface. | class IEventOwner; class Event; class TcpSocket; /** SocketHandler implementing the IEventHandler interface. |
| Line 71 in EventHandler.h | Line 72 in EventHandler.h |
std::list<Event *> m_events; bool m_quit; EventSocket *m_socket; port_t m_port; }; | std::list<Event *> m_events; bool m_quit; TcpSocket *m_socket; port_t m_port; }; |
| Line 81 in EventHandler.h | Line 82 in EventHandler.h |
#endif #endif // _EVENTHANDLER_H | #endif #endif // _SOCKETS_EventHandler_H |
EventTime.h | |
| /usr/src/Sockets-2.1.3/EventTime.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/EventTime.h Thu May 10, 2007 |
| Line 28 in EventTime.h | Line 28 in EventTime.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_EVENTTIME_H #define _SOCKETS_EVENTTIME_H #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_EventTime_H #define _SOCKETS_EventTime_H #include "sockets-config.h" #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { |
| Line 73 in EventTime.h | Line 74 in EventTime.h |
#endif #endif // _SOCKETS_EVENTTIME_H | #endif #endif // _SOCKETS_EventTime_H |
File.h | |
| /usr/src/Sockets-2.1.3/File.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/File.h Thu May 10, 2007 |
| Line 28 in File.h | Line 28 in File.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_FILE_H #define _SOCKETS_FILE_H #include "IFile.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_File_H #define _SOCKETS_File_H #include "sockets-config.h" #include "IFile.h" |
| Line 74 in File.h | Line 75 in File.h |
#endif #endif // _SOCKETS_FILE_H | #endif #endif // _SOCKETS_File_H |
HTTPSocket.h | |
| /usr/src/Sockets-2.1.3/HTTPSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HTTPSocket.h Thu May 10, 2007 |
| Line 28 in HTTPSocket.h | Line 28 in HTTPSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HTTPSOCKET_H #define _HTTPSOCKET_H #include <map> #include "TcpSocket.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_HTTPSocket_H #define _SOCKETS_HTTPSocket_H #include "sockets-config.h" #include <map> #include "TcpSocket.h" |
| Line 143 in HTTPSocket.h | Line 144 in HTTPSocket.h |
#endif #endif // _HTTPSOCKET_H | #endif #endif // _SOCKETS_HTTPSocket_H |
HttpClientSocket.h | |
| /usr/src/Sockets-2.1.3/HttpClientSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HttpClientSocket.h Thu May 10, 2007 |
| Line 21 in HttpClientSocket.h | Line 21 in HttpClientSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HTTPCLIENTSOCKET_H #define _HTTPCLIENTSOCKET_H #include "HTTPSocket.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_HttpClientSocket_H #define _SOCKETS_HttpClientSocket_H #include "sockets-config.h" #include "HTTPSocket.h" |
| Line 116 in HttpClientSocket.h | Line 117 in HttpClientSocket.h |
} // namespace SOCKETS_NAMESPACE { #endif #endif // _HTTPCLIENTSOCKET_H | } // namespace SOCKETS_NAMESPACE { #endif #endif // _SOCKETS_HttpClientSocket_H |
HttpDebugSocket.h | |
| /usr/src/Sockets-2.1.3/HttpDebugSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HttpDebugSocket.h Thu May 10, 2007 |
| Line 27 in HttpDebugSocket.h | Line 27 in HttpDebugSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HttpDebugSocket_H #define _HttpDebugSocket_H #include "HTTPSocket.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_HttpDebugSocket_H #define _SOCKETS_HttpDebugSocket_H #include "sockets-config.h" #include "HTTPSocket.h" |
| Line 66 in HttpDebugSocket.h | Line 67 in HttpDebugSocket.h |
#endif #endif // _HttpDebugSocket_H | #endif #endif // _SOCKETS_HttpDebugSocket_H |
HttpGetSocket.h | |
| /usr/src/Sockets-2.1.3/HttpGetSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HttpGetSocket.h Thu May 10, 2007 |
| Line 28 in HttpGetSocket.h | Line 28 in HttpGetSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HTTPGETSOCKET_H #define _HTTPGETSOCKET_H #include "HttpClientSocket.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_HttpGetSocket_H #define _SOCKETS_HttpGetSocket_H #include "sockets-config.h" #include "HttpClientSocket.h" |
| Line 62 in HttpGetSocket.h | Line 63 in HttpGetSocket.h |
#endif #endif // _HTTPGETSOCKET_H | #endif #endif // _SOCKETS_HttpGetSocket_H |
HttpPostSocket.h | |
| /usr/src/Sockets-2.1.3/HttpPostSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HttpPostSocket.h Thu May 10, 2007 |
| Line 28 in HttpPostSocket.h | Line 28 in HttpPostSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HTTPPOSTSOCKET_H #define _HTTPPOSTSOCKET_H #include "HttpClientSocket.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_HttpPostSocket_H #define _SOCKETS_HttpPostSocket_H #include "sockets-config.h" #include "HttpClientSocket.h" |
| Line 87 in HttpPostSocket.h | Line 88 in HttpPostSocket.h |
#endif #endif // _HTTPPOSTSOCKET_H | #endif #endif // _SOCKETS_HttpPostSocket_H |
HttpPutSocket.h | |
| /usr/src/Sockets-2.1.3/HttpPutSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HttpPutSocket.h Thu May 10, 2007 |
| Line 28 in HttpPutSocket.h | Line 28 in HttpPutSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HTTPPUTSOCKET_H #define _HTTPPUTSOCKET_H #include "HttpClientSocket.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_HttpPutSocket_H #define _SOCKETS_HttpPutSocket_H #include "sockets-config.h" #include "HttpClientSocket.h" |
| Line 79 in HttpPutSocket.h | Line 80 in HttpPutSocket.h |
#endif #endif // _HTTPPUTSOCKET_H | #endif #endif // _SOCKETS_HttpPutSocket_H |
HttpdCookies.h | |
| /usr/src/Sockets-2.1.3/HttpdCookies.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HttpdCookies.h Thu May 10, 2007 |
| Line 27 in HttpdCookies.h | Line 27 in HttpdCookies.h |
*/ #ifndef _COOKIES_H #define _COOKIES_H #include <list> #include <string> | */ #ifndef _SOCKETS_HttpdCookies_H #define _SOCKETS_HttpdCookies_H #include "sockets-config.h" #include <list> #include <string> |
| Line 89 in HttpdCookies.h | Line 90 in HttpdCookies.h |
#endif #endif // _COOKIES_H | #endif #endif // _SOCKETS_HttpdCookies_H |
HttpdForm.h | |
| /usr/src/Sockets-2.1.3/HttpdForm.h Sun Apr 29, 2007 | /usr/src/Sockets-2.1.4/HttpdForm.h Thu May 10, 2007 |
| Line 30 in HttpdForm.h | Line 30 in HttpdForm.h |
*/ #ifndef _FORM_H #define _FORM_H #include <string> #include <list> | */ #ifndef _SOCKETS_HttpdForm_H #define _SOCKETS_HttpdForm_H #include "sockets-config.h" #include <string> #include <list> |
| Line 113 in HttpdForm.h | Line 114 in HttpdForm.h |
#endif #endif // _FORM_H | #endif #endif // _SOCKETS_HttpdForm_H |
HttpdSocket.h | |
| /usr/src/Sockets-2.1.3/HttpdSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/HttpdSocket.h Thu May 10, 2007 |
| Line 26 in HttpdSocket.h | Line 26 in HttpdSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _HTTPDSOCKET_H #define _HTTPDSOCKET_H #include "HTTPSocket.h" #include "ISocketHandler.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_HttpdSocket_H #define _SOCKETS_HttpdSocket_H #include "sockets-config.h" #include "HTTPSocket.h" #include "ISocketHandler.h" |
| Line 96 in HttpdSocket.h | Line 97 in HttpdSocket.h |
#endif #endif // _HTTPDSOCKET_H | #endif #endif // _SOCKETS_HttpdSocket_H |
ICrypt.h | |
| /usr/src/Sockets-2.1.3/ICrypt.h Fri Apr 20, 2007 | /usr/src/Sockets-2.1.4/ICrypt.h Thu May 10, 2007 |
| Line 28 in ICrypt.h | Line 28 in ICrypt.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _ICRYPT_H #define _ICRYPT_H #include <string> | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_ICrypt_H #define _SOCKETS_ICrypt_H #include "sockets-config.h" #include <string> |
| Line 47 in ICrypt.h | Line 48 in ICrypt.h |
#endif // _ICRYPT_H | #endif // _SOCKETS_ICrypt_H |
IEventHandler.h | |
| /usr/src/Sockets-2.1.3/IEventHandler.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/IEventHandler.h Thu May 10, 2007 |
| Line 28 in IEventHandler.h | Line 28 in IEventHandler.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _IEVENTHANDLER_H #define _IEVENTHANDLER_H #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_IEventHandler_H #define _SOCKETS_IEventHandler_H #include "sockets-config.h" #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { |
| Line 70 in IEventHandler.h | Line 71 in IEventHandler.h |
#endif #endif // _IEVENTHANDLER_H | #endif #endif // _SOCKETS_IEventHandler_H |
IEventOwner.cpp | |
| /usr/src/Sockets-2.1.3/IEventOwner.cpp Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/IEventOwner.cpp Wed May 9, 2007 |
| Line 36 in IEventOwner.cpp | Line 36 in IEventOwner.cpp |
IEventOwner::IEventOwner(IEventHandler& h) : m_event_handler(h) { } | IEventOwner::IEventOwner(IEventHandler& h) : m_event_handler(h), m_handler_invalid(false), m_events(0) { } |
| Line 43 in IEventOwner.cpp | Line 43 in IEventOwner.cpp |
IEventOwner::~IEventOwner() { if (m_events && !m_handler_invalid) { m_event_handler.ClearEvents(this); } } | |
| Line 71 in IEventOwner.cpp | Line 74 in IEventOwner.cpp |
void IEventOwner::Increase() { m_events++; } void IEventOwner::Decrease() { if (m_events) m_events--; } #ifdef SOCKETS_NAMESPACE } | |
IEventOwner.h | |
| /usr/src/Sockets-2.1.3/IEventOwner.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/IEventOwner.h Thu May 10, 2007 |
| Line 28 in IEventOwner.h | Line 28 in IEventOwner.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _IEVENTOWNER_H #define _IEVENTOWNER_H #include "IEventHandler.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_IEventOwner_H #define _SOCKETS_IEventOwner_H #include "sockets-config.h" #include "IEventHandler.h" |
| Line 60 in IEventOwner.h | Line 61 in IEventOwner.h |
IEventHandler& EventHandler(); void SetHandlerInvalid(bool x = true) { m_handler_invalid = x; } void Increase(); void Decrease(); private: IEventHandler& m_event_handler; bool m_handler_invalid; int m_events; }; | |
| Line 71 in IEventOwner.h | Line 78 in IEventOwner.h |
#endif #endif // _IEVENTOWNER_H | #endif #endif // _SOCKETS_IEventOwner_H |
IFile.h | |
| /usr/src/Sockets-2.1.3/IFile.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/IFile.h Thu May 10, 2007 |
| Line 28 in IFile.h | Line 28 in IFile.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _IFILE_H #define _IFILE_H #include <string> | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_IFile_H #define _SOCKETS_IFile_H #include "sockets-config.h" #include <string> |
| Line 63 in IFile.h | Line 64 in IFile.h |
#endif #endif // _IFILE_H | #endif #endif // _SOCKETS_IFile_H |
ISocketHandler.h | |
| /usr/src/Sockets-2.1.3/ISocketHandler.h Sun Apr 22, 2007 | /usr/src/Sockets-2.1.4/ISocketHandler.h Thu May 10, 2007 |
| Line 28 in ISocketHandler.h | Line 28 in ISocketHandler.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _ISOCKETHANDLER_H #define _ISOCKETHANDLER_H #include "sockets-config.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_ISocketHandler_H #define _SOCKETS_ISocketHandler_H #include "sockets-config.h" |
| Line 38 in ISocketHandler.h | Line 38 in ISocketHandler.h |
#include "StdLog.h" #include "Mutex.h" #include "Socket.h" #ifdef SOCKETS_NAMESPACE | |
| Line 53 in ISocketHandler.h | Line 54 in ISocketHandler.h |
} list_t; class PoolSocket; class SocketAddress; | |
| Line 64 in ISocketHandler.h | Line 64 in ISocketHandler.h |
public: /** Connection pool class for internal use by the ISocketHandler. \ingroup internal */ #ifdef ENABLE_POOL class PoolSocket : public Socket { public: PoolSocket(ISocketHandler& h,Socket *src) : Socket(h) { CopyConnection( src ); SetIsClient(); } void OnRead() { Handler().LogError(this, "OnRead", 0, "data on hibernating socket", LOG_LEVEL_FATAL); SetCloseAndDelete(); } void OnOptions(int,int,int,SOCKET) {} }; #endif public: /** ISocketHandler constructor. \param log Optional log class pointer */ | |
| Line 127 in ISocketHandler.h | Line 148 in ISocketHandler.h |
#ifdef ENABLE_POOL /** Find available open connection (used by connection pool). */ virtual PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&) { return NULL; } | #ifdef ENABLE_POOL /** Find available open connection (used by connection pool). */ virtual ISocketHandler::PoolSocket *FindConnection(int type,const std::string& protocol,SocketAddress&) { return NULL; } |
| Line 229 in ISocketHandler.h | Line 250 in ISocketHandler.h |
#endif #endif // _ISOCKETHANDLER_H | #endif #endif // _SOCKETS_ISocketHandler_H |
Ipv4Address.h | |
| /usr/src/Sockets-2.1.3/Ipv4Address.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/Ipv4Address.h Thu May 10, 2007 |
| Line 21 in Ipv4Address.h | Line 21 in Ipv4Address.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _IPV4ADDRESS_H #define _IPV4ADDRESS_H #include "SocketAddress.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Ipv4Address_H #define _SOCKETS_Ipv4Address_H #include "sockets-config.h" #include "SocketAddress.h" |
| Line 94 in Ipv4Address.h | Line 95 in Ipv4Address.h |
} // namespace SOCKETS_NAMESPACE { #endif #endif // _IPV4ADDRESS_H | } // namespace SOCKETS_NAMESPACE { #endif #endif // _SOCKETS_Ipv4Address_H |
Ipv6Address.h | |
| /usr/src/Sockets-2.1.3/Ipv6Address.h Sun Apr 22, 2007 | /usr/src/Sockets-2.1.4/Ipv6Address.h Thu May 10, 2007 |
| Line 21 in Ipv6Address.h | Line 21 in Ipv6Address.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _IPV6ADDRESS_H #define _IPV6ADDRESS_H #include "sockets-config.h" #ifdef ENABLE_IPV6 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Ipv6Address_H #define _SOCKETS_Ipv6Address_H #include "sockets-config.h" #ifdef ENABLE_IPV6 |
| Line 104 in Ipv6Address.h | Line 104 in Ipv6Address.h |
#endif // IPPROTO_IPV6 #endif // ENABLE_IPV6 #endif // _IPV6ADDRESS_H | #endif // IPPROTO_IPV6 #endif // ENABLE_IPV6 #endif // _SOCKETS_Ipv6Address_H |
ListenSocket.h | |
| /usr/src/Sockets-2.1.3/ListenSocket.h Mon Apr 30, 2007 | /usr/src/Sockets-2.1.4/ListenSocket.h Thu May 10, 2007 |
| Line 28 in ListenSocket.h | Line 28 in ListenSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _LISTENSOCKET_H #define _LISTENSOCKET_H #include "sockets-config.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_ListenSocket_H #define _SOCKETS_ListenSocket_H #include "sockets-config.h" |
| Line 387 in ListenSocket.h | Line 387 in ListenSocket.h |
// %! See bugfix for this in SocketHandler::Select - don't Set rwx // %! flags if CloseAndDelete() flag is true. // %! An even better fugbix (see TcpSocket::OnSSLAccept) now avoids // %! the Add problem altogether, so ignore the above. // %! (OnSSLAccept does no longer call SSLNegotiate().) tmp -> OnSSLAccept(); } | |
| Line 423 in ListenSocket.h | Line 426 in ListenSocket.h |
#endif #endif // _LISTENSOCKET_H | #endif #endif // _SOCKETS_ListenSocket_H |
Lock.h | |
| /usr/src/Sockets-2.1.3/Lock.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/Lock.h Thu May 10, 2007 |
| Line 28 in Lock.h | Line 28 in Lock.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_LOCK_H #define _SOCKETS_LOCK_H #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Lock_H #define _SOCKETS_Lock_H #include "sockets-config.h" #ifdef SOCKETS_NAMESPACE namespace SOCKETS_NAMESPACE { |
| Line 55 in Lock.h | Line 56 in Lock.h |
} #endif #endif // _SOCKETS_LOCK_H | } #endif #endif // _SOCKETS_Lock_H |
Makefile | |
| /usr/src/Sockets-2.1.3/Makefile Sun Apr 29, 2007 | /usr/src/Sockets-2.1.4/Makefile Thu May 10, 2007 |
| Line 78 in Makefile | Line 78 in Makefile |
@rm -f $(PREFIX)/include/Sockets/HttpsGetSocket.* @rm -f $(PREFIX)/include/Sockets/HttpsSocket.* @rm -f $(PREFIX)/include/Sockets/EventSocket.* @rm -f $(PREFIX)/include/Sockets/PoolSocket.* @rm -f $(PREFIX)/include/Sockets/SocketThread.* @mkdir -p $(PREFIX)/bin install Sockets-config $(PREFIX)/bin | |
Makefile.version | |
| /usr/src/Sockets-2.1.3/Makefile.version Mon Apr 30, 2007 | /usr/src/Sockets-2.1.4/Makefile.version Thu May 10, 2007 |
| Line 1 in Makefile.version | Line 1 in Makefile.version |
VERSION = 2.1.3 DIFF_VERSION = 2.1.2 # Sockets | VERSION = 2.1.4 DIFF_VERSION = 2.1.3 # Sockets |
| Line 12 in Makefile.version | Line 12 in Makefile.version |
HttpGetSocket.o \ HTTPSocket.o \ Thread.o SocketThread.o \ StdoutLog.o \ HttpPutSocket.o \ | HttpGetSocket.o \ HTTPSocket.o \ Thread.o \ StdoutLog.o \ HttpPutSocket.o \ |
| Line 18 in Makefile.version | Line 18 in Makefile.version |
HttpDebugSocket.o \ Utility.o \ PoolSocket.o \ ResolvServer.o \ ResolvSocket.o \ | |
| Line 36 in Makefile.version | Line 35 in Makefile.version |
Semaphore.o \ RandomNumber.o \ EventSocket.o \ SSLInitializer.o # SocketsEx | Semaphore.o \ RandomNumber.o \ SSLInitializer.o \ SmtpdSocket.o # SocketsEx |
MemFile.h | |
| /usr/src/Sockets-2.1.3/MemFile.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/MemFile.h Thu May 10, 2007 |
| Line 28 in MemFile.h | Line 28 in MemFile.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MEMFILE_H #define _MEMFILE_H #include <map> #include "IFile.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_MemFile_H #define _SOCKETS_MemFile_H #include "sockets-config.h" #include <map> #include "IFile.h" |
| Line 92 in MemFile.h | Line 93 in MemFile.h |
#endif #endif // _MEMFILE_H | #endif #endif // _SOCKETS_MemFile_H |
MinderHandler.h | |
| /usr/src/Sockets-2.1.3/MinderHandler.h Sat Apr 21, 2007 | /usr/src/Sockets-2.1.4/MinderHandler.h Thu May 10, 2007 |
| Line 21 in MinderHandler.h | Line 21 in MinderHandler.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MINION_MINDERHANDLER_H #define _MINION_MINDERHANDLER_H #include "sockets-config.h" #ifdef HAVE_OPENSSL | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MINION_MinderHandler_H #define _MINION_MinderHandler_H #include "sockets-config.h" #ifdef HAVE_OPENSSL |
| Line 152 in MinderHandler.h | Line 152 in MinderHandler.h |
#endif // HAVE_OPENSSL #endif // _MINION_MINDERHANDLER_H | #endif // HAVE_OPENSSL #endif // _MINION_MinderHandler_H |
MinderSocket.h | |
| /usr/src/Sockets-2.1.3/MinderSocket.h Sat Apr 21, 2007 | /usr/src/Sockets-2.1.4/MinderSocket.h Thu May 10, 2007 |
| Line 21 in MinderSocket.h | Line 21 in MinderSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MINDERSOCKET_H #define _MINDERSOCKET_H #include "sockets-config.h" #ifdef HAVE_OPENSSL | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_MinderSocket_H #define _SOCKETS_MinderSocket_H #include "sockets-config.h" #ifdef HAVE_OPENSSL |
| Line 79 in MinderSocket.h | Line 79 in MinderSocket.h |
#endif // HAVE_OPENSSL #endif // _MINDERSOCKET_H | #endif // HAVE_OPENSSL #endif // _SOCKETS_MinderSocket_H |
MinionSocket.h | |
| /usr/src/Sockets-2.1.3/MinionSocket.h Sat Apr 21, 2007 | /usr/src/Sockets-2.1.4/MinionSocket.h Thu May 10, 2007 |
| Line 21 in MinionSocket.h | Line 21 in MinionSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _MINIONSOCKET_H #define _MINIONSOCKET_H #include "sockets-config.h" #ifdef HAVE_OPENSSL | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_MinionSocket_H #define _SOCKETS_MinionSocket_H #include "sockets-config.h" #ifdef HAVE_OPENSSL |
| Line 112 in MinionSocket.h | Line 112 in MinionSocket.h |
#endif // HAVE_OPENSSL #endif // _MINIONSOCKET_H | #endif // HAVE_OPENSSL #endif // _SOCKETS_MinionSocket_H |
Mutex.h | |
| /usr/src/Sockets-2.1.3/Mutex.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/Mutex.h Thu May 10, 2007 |
| Line 28 in Mutex.h | Line 28 in Mutex.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_MUTEX_H #define _SOCKETS_MUTEX_H #ifndef _WIN32 #include <pthread.h> | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Mutex_H #define _SOCKETS_Mutex_H #include "sockets-config.h" #ifndef _WIN32 #include <pthread.h> |
| Line 64 in Mutex.h | Line 65 in Mutex.h |
} #endif #endif // _SOCKETS_MUTEX_H | } #endif #endif // _SOCKETS_Mutex_H |
NullCrypt.h | |
| /usr/src/Sockets-2.1.3/NullCrypt.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/NullCrypt.h Thu May 10, 2007 |
| Line 28 in NullCrypt.h | Line 28 in NullCrypt.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _NULLCRYPT_H #define _NULLCRYPT_H #include "ICrypt.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_NullCrypt_H #define _SOCKETS_NullCrypt_H #include "sockets-config.h" #include "ICrypt.h" |
| Line 56 in NullCrypt.h | Line 57 in NullCrypt.h |
#endif #endif // _NULLCRYPT_H | #endif #endif // _SOCKETS_NullCrypt_H |
Parse.h | |
| /usr/src/Sockets-2.1.3/Parse.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/Parse.h Thu May 10, 2007 |
| Line 30 in Parse.h | Line 30 in Parse.h |
*/ #ifndef _PARSE_H #define _PARSE_H #ifdef _WIN32 #pragma warning(disable:4514) | */ #ifndef _SOCKETS_Parse_H #define _SOCKETS_Parse_H #include "sockets-config.h" #ifdef _WIN32 #pragma warning(disable:4514) |
| Line 97 in Parse.h | Line 98 in Parse.h |
#endif #endif // _PARSE_H | #endif #endif // _SOCKETS_Parse_H |
RandomNumber.h | |
| /usr/src/Sockets-2.1.3/RandomNumber.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/RandomNumber.h Thu May 10, 2007 |
| Line 19 in RandomNumber.h | Line 19 in RandomNumber.h |
*/ #ifndef RANDOM_NUMBER_H #define RANDOM_NUMBER_H #include <limits> | */ #ifndef _SOCKET_RandomNumber_H #define _SOCKET_RandomNumber_H #include "sockets-config.h" #include <limits> |
| Line 198 in RandomNumber.h | Line 199 in RandomNumber.h |
#endif #endif | #endif #endif // _SOCKETS_RandomNumber_H |
ResolvServer.h | |
| /usr/src/Sockets-2.1.3/ResolvServer.h Tue Apr 17, 2007 | /usr/src/Sockets-2.1.4/ResolvServer.h Thu May 10, 2007 |
| Line 28 in ResolvServer.h | Line 28 in ResolvServer.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _RESOLVSERVER_H #define _RESOLVSERVER_H #include "sockets-config.h" #ifdef ENABLE_RESOLVER | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_ResolvServer_H #define _SOCKETS_ResolvServer_H #include "sockets-config.h" #ifdef ENABLE_RESOLVER |
| Line 70 in ResolvServer.h | Line 70 in ResolvServer.h |
#endif // ENABLE_RESOLVER #endif // _RESOLVSERVER_H | #endif // ENABLE_RESOLVER #endif // _SOCKETS_ResolvServer_H |
ResolvSocket.h | |
| /usr/src/Sockets-2.1.3/ResolvSocket.h Thu Apr 26, 2007 | /usr/src/Sockets-2.1.4/ResolvSocket.h Thu May 10, 2007 |
| Line 28 in ResolvSocket.h | Line 28 in ResolvSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _RESOLVSOCKET_H #define _RESOLVSOCKET_H #include "sockets-config.h" #ifdef ENABLE_RESOLVER | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_ResolvSocket_H #define _SOCKETS_ResolvSocket_H #include "sockets-config.h" #ifdef ENABLE_RESOLVER |
| Line 90 in ResolvSocket.h | Line 90 in ResolvSocket.h |
#endif // ENABLE_RESOLVER #endif // _RESOLVSOCKET_H | #endif // ENABLE_RESOLVER #endif // _SOCKETS_ResolvSocket_H |
SSLInitializer.cpp | |
| /usr/src/Sockets-2.1.3/SSLInitializer.cpp Mon Apr 30, 2007 | /usr/src/Sockets-2.1.4/SSLInitializer.cpp Wed May 9, 2007 |
| Line 21 in SSLInitializer.cpp | Line 21 in SSLInitializer.cpp |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef _WIN32 #pragma warning(disable:4786) #endif #include "SSLInitializer.h" #ifdef HAVE_OPENSSL | |
SSLInitializer.h | |
| /usr/src/Sockets-2.1.3/SSLInitializer.h Mon Apr 30, 2007 | /usr/src/Sockets-2.1.4/SSLInitializer.h Thu May 10, 2007 |
| Line 21 in SSLInitializer.h | Line 21 in SSLInitializer.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SSLINITIALIZER_H #define _SSLINITIALIZER_H #include "sockets-config.h" #ifdef HAVE_OPENSSL | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SOCKETS_SSLInitializer_H #define __SOCKETS_SSLInitializer_H #include "sockets-config.h" #ifdef HAVE_OPENSSL |
| Line 73 in SSLInitializer.h | Line 73 in SSLInitializer.h |
#endif #endif // HAVE_OPENSSL #endif // _SSLINITIALIZER_H | #endif #endif // HAVE_OPENSSL #endif // __SOCKETS_SSLInitializer_H |
SctpSocket.h | |
| /usr/src/Sockets-2.1.3/SctpSocket.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/SctpSocket.h Thu May 10, 2007 |
| Line 21 in SctpSocket.h | Line 21 in SctpSocket.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_NAMESPACE_SCTPSOCKET_H #define _SOCKETS_NAMESPACE_SCTPSOCKET_H #include "sockets-config.h" | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_SctpSocket_H #define _SOCKETS_SctpSocket_H #include "sockets-config.h" |
| Line 93 in SctpSocket.h | Line 93 in SctpSocket.h |
#endif // USE_SCTP #endif // _SOCKETS_NAMESPACE_SCTPSOCKET_H | #endif // USE_SCTP #endif // _SOCKETS_SctpSocket_H |
Semaphore.h | |
| /usr/src/Sockets-2.1.3/Semaphore.h Sun Apr 15, 2007 | /usr/src/Sockets-2.1.4/Semaphore.h Thu May 10, 2007 |
| Line 21 in Semaphore.h | Line 21 in Semaphore.h |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_SEMAPHORE_H #define _SOCKETS_SEMAPHORE_H #include <pthread.h> #include <semaphore.h> | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _SOCKETS_Semaphore_H #define _SOCKETS_Semaphore_H #include "sockets-config.h" #include <pthread.h> #include <semaphore.h> |
| Line 59 in Semaphore.h | Line 60 in Semaphore.h |
} // namespace SOCKETS_NAMESPACE { #endif #endif // _SOCKETS_SEMAPHORE_H | } // namespace SOCKETS_NAMESPACE { #endif #endif // _SOCKETS_Semaphore_H |
Socket.cpp | |
| /usr/src/Sockets-2.1.3/Socket.cpp Sun Apr 22, 2007 | /usr/src/Sockets-2.1.4/Socket.cpp Thu May 10, 2007 |
| Line 40 in Socket.cpp | Line 40 in Socket.cpp |
#include "ISocketHandler.h" #include "SocketThread.h" #include "Utility.h" #include "TcpSocket.h" #include "SocketAddress.h" #ifdef SOCKETS_NAMESPACE | #include "ISocketHandler.h" #include "Utility.h" #include "TcpSocket.h" #include "SocketAddress.h" #include "SocketHandler.h" #ifdef _DEBUG #define DEB(x) x; fflush(stderr); #else #define DEB(x) #endif #ifdef SOCKETS_NAMESPACE |
| Line 85 in Socket.cpp | Line 91 in Socket.cpp |
,m_client_remote_address(NULL) ,m_remote_address(NULL) ,m_traffic_monitor(NULL) #ifdef HAVE_OPENSSL ,m_b_enable_ssl(false) | |
| Line 229 in Socket.cpp | Line 236 in Socket.cpp |
int Socket::Close() { DEB( fprintf(stderr, " fd %d\n", m_socket);) if (m_socket == INVALID_SOCKET) // this could happen { | |
| Line 236 in Socket.cpp | Line 244 in Socket.cpp |
int n; SetNonblocking(true); if (IsConnected()) { if (shutdown(m_socket, SHUT_WR) == -1) | int n; SetNonblocking(true); if (IsConnected() && !(GetShutdown() & SHUT_WR)) { if (shutdown(m_socket, SHUT_WR) == -1) |
| Line 271 in Socket.cpp | Line 279 in Socket.cpp |
Handler().AddList(m_socket, LIST_CLOSE, false); m_socket = INVALID_SOCKET; DEB( fprintf(stderr, " fd %d\n", m_socket);) return n; } | |
| Line 592 in Socket.cpp | Line 601 in Socket.cpp |
#ifdef ENABLE_DETACH bool Socket::Detach() { if (!DeleteByHandler()) return false; if (m_pThread) return false; if (m_detached) return false; SetDetach(); return true; } void Socket::DetachSocket() { SetDetached(); m_pThread = new SocketThread(this); m_pThread -> SetRelease(true); } #endif void Socket::OnLine(const std::string& ) { | |
| Line 632 in Socket.cpp | Line 618 in Socket.cpp |
/* void Socket::ReadLine() { } */ void Socket::OnConnectFailed() { | |
| Line 668 in Socket.cpp | Line 647 in Socket.cpp |
#ifdef ENABLE_POOL void Socket::CopyConnection(Socket *sock) { Attach( sock -> GetSocket() ); #ifdef ENABLE_IPV6 SetIpv6( sock -> IsIpv6() ); #endif SetSocketType( sock -> GetSocketType() ); SetSocketProtocol( sock -> GetSocketProtocol() ); /* SocketAddress *client = sock -> GetClientRemoteAddress(); if (client) { SetClientRemoteAddress( *client ); } */ SetClientRemoteAddress( *sock -> GetClientRemoteAddress() ); /* SocketAddress *remote = GetRemoteSocketAddress(); if (remote) { SetRemoteAddress(*remote); } */ SetRemoteAddress( *sock -> GetRemoteSocketAddress() ); } #endif #ifdef ENABLE_RESOLVER int Socket::Resolve(const std::string& host,port_t port) { return Handler().Resolve(this, host, port); } #ifdef ENABLE_IPV6 int Socket::Resolve6(const std::string& host,port_t port) { return Handler().Resolve6(this, host, port); } #endif int Socket::Resolve(ipaddr_t a) { return Handler().Resolve(this, a); } #ifdef ENABLE_IPV6 int Socket::Resolve(in6_addr& a) { return Handler().Resolve(this, a); } #endif #endif #ifdef ENABLE_SOCKS4 void Socket::OnSocks4Connect() { Handler().LogError(this, "OnSocks4Connect", 0, "Use with TcpSocket only"); } void Socket::OnSocks4ConnectFailed() { Handler().LogError(this, "OnSocks4ConnectFailed", 0, "Use with TcpSocket only"); } bool Socket::OnSocks4Read() { Handler().LogError(this, "OnSocks4Read", 0, "Use with TcpSocket only"); return true; } void Socket::SetSocks4Host(const std::string& host) { Utility::u2ip(host, m_socks4_host); } #endif /* void Socket::OnWriteComplete() { } */ #ifdef ENABLE_RESOLVER void Socket::OnResolved(int,ipaddr_t,port_t) { } #ifdef ENABLE_IPV6 void Socket::OnResolved(int,in6_addr&,port_t) { } #endif void Socket::OnReverseResolved(int,const std::string&) { } void Socket::OnResolveFailed(int) { } #endif Socket *Socket::Create() { return NULL; } #ifdef HAVE_OPENSSL void Socket::OnSSLConnect() { } void Socket::OnSSLAccept() { } #endif bool Socket::OnConnectRetry() { return true; } #ifdef ENABLE_RECONNECT void Socket::OnReconnect() { } #endif #ifdef HAVE_OPENSSL bool Socket::SSLNegotiate() { return false; } #endif time_t Socket::Uptime() { return time(NULL) - m_tCreate; } #ifdef ENABLE_DETACH void Socket::OnDetached() { } void Socket::SetDetach(bool x) { Handler().AddList(m_socket, LIST_DETACH, x); m_detach = x; } bool Socket::IsDetach() { return m_detach; } void Socket::SetDetached(bool x) { m_detached = x; } const bool Socket::IsDetached() const { return m_detached; } #endif #ifdef ENABLE_IPV6 void Socket::SetIpv6(bool x) { m_ipv6 = x; } bool Socket::IsIpv6() { return m_ipv6; } #endif #ifdef ENABLE_POOL void Socket::SetIsClient() { m_bClient = true; } void Socket::SetSocketType(int x) { m_socket_type = x; } int Socket::GetSocketType() { return m_socket_type; } void Socket::SetSocketProtocol(const std::string& x) { m_socket_protocol = x; } const std::string& Socket::GetSocketProtocol() { return m_socket_protocol; } void Socket::SetRetain() { if (m_bClient) m_bRetain = true; } bool Socket::Retain() { return m_bRetain; } void Socket::SetLost() { m_bLost = true; } bool Socket::Lost() { return m_bLost; } #endif void Socket::SetCallOnConnect(bool x) { Handler().AddList(m_socket, LIST_CALLONCONNECT, x); m_call_on_connect = x; } bool Socket::CallOnConnect() { return m_call_on_connect; } void Socket::SetReuse(bool x) { m_opt_reuse = x; } void Socket::SetKeepalive(bool x) { m_opt_keepalive = x; } #ifdef ENABLE_SOCKS4 bool Socket::Socks4() { return m_bSocks4; } void Socket::SetSocks4(bool x) { m_bSocks4 = x; } void Socket::SetSocks4Host(ipaddr_t a) { m_socks4_host = a; } void Socket::SetSocks4Port(port_t p) { m_socks4_port = p; } void Socket::SetSocks4Userid(const std::string& x) { m_socks4_userid = x; } ipaddr_t Socket::GetSocks4Host() { return m_socks4_host; } port_t Socket::GetSocks4Port() { return m_socks4_port; } const std::string& Socket::GetSocks4Userid() { return m_socks4_userid; } #endif void Socket::SetConnectTimeout(int x) { m_connect_timeout = x; } int Socket::GetConnectTimeout() { return m_connect_timeout; } #ifdef HAVE_OPENSSL bool Socket::IsSSL() { return m_b_enable_ssl; } void Socket::EnableSSL(bool x) { m_b_enable_ssl = x; } bool Socket::IsSSLNegotiate() { return m_b_ssl; } void Socket::SetSSLNegotiate(bool x) { m_b_ssl = x; } bool Socket::IsSSLServer() { return m_b_ssl_server; } void Socket::SetSSLServer(bool x) { m_b_ssl_server = x; } #endif void Socket::DisableRead(bool x) { m_b_disable_read = x; } bool Socket::IsDisableRead() { return m_b_disable_read; } void Socket::SetRetryClientConnect(bool x) { Handler().AddList(m_socket, LIST_RETRY, x); m_b_retry_connect = x; } bool Socket::RetryClientConnect() { return m_b_retry_connect; } void Socket::SendBuf(const char *,size_t,int) { } void Socket::Send(const std::string&,int) { } void Socket::SetConnected(bool x) { m_connected = x; } bool Socket::IsConnected() { return m_connected; } void Socket::SetFlushBeforeClose(bool x) { m_flush_before_close = x; } bool Socket::GetFlushBeforeClose() { return m_flush_before_close; } #ifdef HAVE_OPENSSL void Socket::OnSSLConnectFailed() { } void Socket::OnSSLAcceptFailed() { } #endif int Socket::GetConnectionRetry() { return m_connection_retry; } void Socket::SetConnectionRetry(int x) { m_connection_retry = x; } int Socket::GetConnectionRetries() { return m_retries; } void Socket::IncreaseConnectionRetries() { m_retries++; } void Socket::ResetConnectionRetries() { m_retries = 0; } #ifdef ENABLE_RECONNECT void Socket::OnDisconnect() { } #endif void Socket::SetErasedByHandler(bool x) { m_b_erased_by_handler = x; } bool Socket::ErasedByHandler() { return m_b_erased_by_handler; } #ifdef ENABLE_DETACH void Socket::SetSlaveHandler(ISocketHandler *p) { m_slave_handler = p; } #endif time_t Socket::TimeSinceClose() { return time(NULL) - m_tClose; } void Socket::SetShutdown(int x) { m_shutdown = x; } int Socket::GetShutdown() { return m_shutdown; } void Socket::SetClientRemoteAddress(SocketAddress& ad) { if (!ad.IsValid()) { Handler().LogError(this, "SetClientRemoteAddress", 0, "remote address not valid", LOG_LEVEL_ERROR); } m_client_remote_address = ad.GetCopy(); } std::auto_ptr<SocketAddress> Socket::GetClientRemoteAddress() { if (!m_client_remote_address.get()) { Handler().LogError(this, "GetClientRemoteAddress", 0, "remote address not yet set", LOG_LEVEL_ERROR); } return std::auto_ptr<SocketAddress>(m_client_remote_address -> GetCopy()); } uint64_t Socket::GetBytesSent(bool) { return 0; } uint64_t Socket::GetBytesReceived(bool) { return 0; } unsigned long int Socket::Random() { return m_prng.next(); } | Socket *Socket::Create() { return NULL; } bool Socket::OnConnectRetry() { return true; } #ifdef ENABLE_RECONNECT void Socket::OnReconnect() { } #endif time_t Socket::Uptime() { return time(NULL) - m_tCreate; } #ifdef ENABLE_IPV6 void Socket::SetIpv6(bool x) { m_ipv6 = x; } bool Socket::IsIpv6() { return m_ipv6; } #endif void Socket::SetCallOnConnect(bool x) { Handler().AddList(m_socket, LIST_CALLONCONNECT, x); m_call_on_connect = x; } bool Socket::CallOnConnect() { return m_call_on_connect; } void Socket::SetReuse(bool x) { m_opt_reuse = x; } void Socket::SetKeepalive(bool x) { m_opt_keepalive = x; } void Socket::SetConnectTimeout(int x) { m_connect_timeout = x; } int Socket::GetConnectTimeout() { return m_connect_timeout; } void Socket::DisableRead(bool x) { m_b_disable_read = x; } bool Socket::IsDisableRead() { return m_b_disable_read; } void Socket::SetRetryClientConnect(bool x) { Handler().AddList(m_socket, LIST_RETRY, x); m_b_retry_connect = x; } bool Socket::RetryClientConnect() { return m_b_retry_connect; } void Socket::SendBuf(const char *,size_t,int) { } void Socket::Send(const std::string&,int) { } void Socket::SetConnected(bool x) { m_connected = x; } bool Socket::IsConnected() { return m_connected; } void Socket::SetFlushBeforeClose(bool x) { m_flush_before_close = x; } bool Socket::GetFlushBeforeClose() { return m_flush_before_close; } int Socket::GetConnectionRetry() { return m_connection_retry; } void Socket::SetConnectionRetry(int x) { m_connection_retry = x; } int Socket::GetConnectionRetries() { return m_retries; } void Socket::IncreaseConnectionRetries() { m_retries++; } void Socket::ResetConnectionRetries() { m_retries = 0; } #ifdef ENABLE_RECONNECT void Socket::OnDisconnect() { } #endif void Socket::SetErasedByHandler(bool x) { m_b_erased_by_handler = x; } bool Socket::ErasedByHandler() { return m_b_erased_by_handler; } time_t Socket::TimeSinceClose() { return time(NULL) - m_tClose; } void Socket::SetShutdown(int x) { m_shutdown = x; } int Socket::GetShutdown() { return m_shutdown; } void Socket::SetClientRemoteAddress(SocketAddress& ad) { if (!ad.IsValid()) { Handler().LogError(this, "SetClientRemoteAddress", 0, "remote address not valid", LOG_LEVEL_ERROR); } m_client_remote_address = ad.GetCopy(); } std::auto_ptr<SocketAddress> Socket::GetClientRemoteAddress() { if (!m_client_remote_address.get()) { Handler().LogError(this, "GetClientRemoteAddress", 0, "remote address not yet set", LOG_LEVEL_ERROR); } return std::auto_ptr<SocketAddress>(m_client_remote_address -> GetCopy()); } uint64_t Socket::GetBytesSent(bool) { return 0; } uint64_t Socket::GetBytesReceived(bool) { return 0; } unsigned long int Socket::Random() { return m_prng.next(); } #ifdef HAVE_OPENSSL void Socket::OnSSLConnect() { } void Socket::OnSSLAccept() { } bool Socket::SSLNegotiate() { return false; } bool Socket::IsSSL() { return m_b_enable_ssl; } void Socket::EnableSSL(bool x) { m_b_enable_ssl = x; } bool Socket::IsSSLNegotiate() { return m_b_ssl; } void Socket::SetSSLNegotiate(bool x) { m_b_ssl = x; } bool Socket::IsSSLServer() { return m_b_ssl_server; } void Socket::SetSSLServer(bool x) { m_b_ssl_server = x; } void Socket::OnSSLConnectFailed() { } void Socket::OnSSLAcceptFailed() { } #endif // HAVE_OPENSSL #ifdef ENABLE_POOL void Socket::CopyConnection(Socket *sock) { Attach( sock -> GetSocket() ); #ifdef ENABLE_IPV6 SetIpv6( sock -> IsIpv6() ); #endif SetSocketType( sock -> GetSocketType() ); SetSocketProtocol( sock -> GetSocketProtocol() ); SetClientRemoteAddress( *sock -> GetClientRemoteAddress() ); SetRemoteAddress( *sock -> GetRemoteSocketAddress() ); } void Socket::SetIsClient() { m_bClient = true; } void Socket::SetSocketType(int x) { m_socket_type = x; } int Socket::GetSocketType() { return m_socket_type; } void Socket::SetSocketProtocol(const std::string& x) { m_socket_protocol = x; } const std::string& Socket::GetSocketProtocol() { return m_socket_protocol; } void Socket::SetRetain() { if (m_bClient) m_bRetain = true; } bool Socket::Retain() { return m_bRetain; } void Socket::SetLost() { m_bLost = true; } bool Socket::Lost() { return m_bLost; } #endif // ENABLE_POOL #ifdef ENABLE_SOCKS4 void Socket::OnSocks4Connect() { Handler().LogError(this, "OnSocks4Connect", 0, "Use with TcpSocket only"); } void Socket::OnSocks4ConnectFailed() { Handler().LogError(this, "OnSocks4ConnectFailed", 0, "Use with TcpSocket only"); } bool Socket::OnSocks4Read() { Handler().LogError(this, "OnSocks4Read", 0, "Use with TcpSocket only"); return true; } void Socket::SetSocks4Host(const std::string& host) { Utility::u2ip(host, m_socks4_host); } bool Socket::Socks4() { return m_bSocks4; } void Socket::SetSocks4(bool x) { m_bSocks4 = x; } void Socket::SetSocks |