summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/treesocket.h
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-21 13:26:31 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-09-21 13:26:31 +0000
commite2af2347fc035d702e45f12e772223a8d578410d (patch)
treebfd80aac2858a9f4faedc316794fc1051dbaa72c /src/modules/m_spanningtree/treesocket.h
parent16fc672b685752007e47aed0fb97bc1ee7443c76 (diff)
Create StreamSocket for IO hooking implementation
Fixes the SSL SendQ bug Removes duplicate code between User and BufferedSocket Simplify SSL module API Simplify EventHandler API (Readable/Writeable moved to SE) Add hook for culled objects to invoke callbacks prior to destructor Replace SocketCull with GlobalCull now that sockets can close themselves Shorten common case of user read/parse/write path: User::Write is now zero-copy up to syscall/SSL invocation User::Read has only two copy/scan passes from read() to ProcessCommand git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11752 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/treesocket.h')
-rw-r--r--src/modules/m_spanningtree/treesocket.h31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h
index a26e89f85..3c9484981 100644
--- a/src/modules/m_spanningtree/treesocket.h
+++ b/src/modules/m_spanningtree/treesocket.h
@@ -71,7 +71,6 @@ class TreeSocket : public BufferedSocket
{
SpanningTreeUtilities* Utils; /* Utility class */
std::string myhost; /* Canonical hostname */
- std::string in_buffer; /* Input buffer */
ServerState LinkState; /* Link state */
std::string InboundServerName; /* Server name sent to us by other side */
std::string InboundDescription; /* Server description (GECOS) sent to us by the other side */
@@ -80,10 +79,10 @@ class TreeSocket : public BufferedSocket
int num_lost_servers; /* Servers lost in split */
time_t NextPing; /* Time when we are due to ping this server */
bool LastPingWasGood; /* Responded to last ping we sent? */
+ std::string IP;
std::string ModuleList; /* Required module list of other server from CAPAB */
std::string OptModuleList; /* Optional module list of other server from CAPAB */
std::map<std::string,std::string> CapKeys; /* CAPAB keys from other server */
- Module* Hook; /* I/O hooking module that we're attached to for this socket */
std::string ourchallenge; /* Challenge sent for challenge/response */
std::string theirchallenge; /* Challenge recv for challenge/response */
std::string OutboundPass; /* Outbound password */
@@ -101,13 +100,13 @@ class TreeSocket : public BufferedSocket
* most of the action, and append a few of our own values
* to it.
*/
- TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string host, int port, unsigned long maxtime, const std::string &ServerName, const std::string &bindto, Autoconnect* myac, Module* HookMod = NULL);
+ TreeSocket(SpanningTreeUtilities* Util, std::string host, int port, unsigned long maxtime, const std::string &ServerName, const std::string &bindto, Autoconnect* myac, Module* HookMod = NULL);
/** When a listening socket gives us a new file descriptor,
* we must associate it with a socket without creating a new
* connection. This constructor is used for this purpose.
*/
- TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, char* ip, Autoconnect* myac, Module* HookMod = NULL);
+ TreeSocket(SpanningTreeUtilities* Util, int newfd, char* ip, Autoconnect* myac, Module* HookMod = NULL);
/** Get link state
*/
@@ -137,10 +136,6 @@ class TreeSocket : public BufferedSocket
*/
void CleanNegotiationInfo();
- /** Return the module which we are hooking to for I/O encapsulation
- */
- Module* GetHook();
-
/** Destructor
*/
~TreeSocket();
@@ -160,7 +155,7 @@ class TreeSocket : public BufferedSocket
* to server docs on the inspircd.org site, the other side
* will then send back its own server string.
*/
- virtual bool OnConnected();
+ virtual void OnConnected();
/** Handle socket error event
*/
@@ -171,10 +166,6 @@ class TreeSocket : public BufferedSocket
*/
void SendError(const std::string &errormessage);
- /** Handle socket disconnect event
- */
- virtual int OnDisconnect();
-
/** Recursively send the server tree with distances as hops.
* This is used during network burst to inform the other server
* (and any of ITS servers too) of what servers we know about.
@@ -258,14 +249,9 @@ class TreeSocket : public BufferedSocket
void DoBurst(TreeServer* s);
/** This function is called when we receive data from a remote
- * server. We buffer the data in a std::string (it doesnt stay
- * there for long), reading using BufferedSocket::Read() which can
- * read up to 16 kilobytes in one operation.
- *
- * IF THIS FUNCTION RETURNS FALSE, THE CORE CLOSES AND DELETES
- * THE SOCKET OBJECT FOR US.
+ * server.
*/
- virtual bool OnDataReady();
+ void OnDataReady();
/** Send one or more complete lines down the socket
*/
@@ -404,10 +390,9 @@ class TreeSocket : public BufferedSocket
/** Handle socket timeout from connect()
*/
virtual void OnTimeout();
-
- /** Handle socket close event
+ /** Handle server quit on close
*/
- virtual void OnClose();
+ virtual void Close();
};
/* Used to validate the value lengths of multiple parameters for a command */