diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-15 21:04:32 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-10-15 21:04:32 +0000 |
commit | 2b68243097f98ace4a53b21520718874b0ed7db5 (patch) | |
tree | 5fbdbb4270efebbfb0956733d25b1245c8586d25 /src/modules/m_spanningtree | |
parent | 03e0fb206d3f5709868f03bc7a401cb666c38ffb (diff) |
InspSocket -> BufferedSocket. Paves the way for a SimpleSocket class which ident etc will use.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8206 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree')
-rw-r--r-- | src/modules/m_spanningtree/handshaketimer.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/main.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/override_stats.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/resolvers.cpp | 4 | ||||
-rw-r--r-- | src/modules/m_spanningtree/resolvers.h | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket.h | 12 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 22 | ||||
-rw-r--r-- | src/modules/m_spanningtree/treesocket2.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.cpp | 8 | ||||
-rw-r--r-- | src/modules/m_spanningtree/utils.h | 2 |
10 files changed, 31 insertions, 31 deletions
diff --git a/src/modules/m_spanningtree/handshaketimer.cpp b/src/modules/m_spanningtree/handshaketimer.cpp index ffe81ad80..1108c5dcc 100644 --- a/src/modules/m_spanningtree/handshaketimer.cpp +++ b/src/modules/m_spanningtree/handshaketimer.cpp @@ -43,9 +43,9 @@ void HandshakeTimer::Tick(time_t TIME) } else { - if (sock->GetHook() && InspSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send()) + if (sock->GetHook() && BufferedSocketHSCompleteRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send()) { - InspSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send(); + BufferedSocketAttachCertRequest(sock, (Module*)Utils->Creator, sock->GetHook()).Send(); sock->SendCapabilities(); } else diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 62f288fb3..2ccf510c7 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -36,7 +36,7 @@ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) : Module(Me), max_local(0), max_global(0) { - ServerInstance->Modules->UseInterface("InspSocketHook"); + ServerInstance->Modules->UseInterface("BufferedSocketHook"); Utils = new SpanningTreeUtilities(Me, this); command_rconnect = new cmd_rconnect(ServerInstance, this, Utils); ServerInstance->AddCommand(command_rconnect); @@ -1016,7 +1016,7 @@ ModuleSpanningTree::~ModuleSpanningTree() ServerInstance->Timers->DelTimer(RefreshTimer); - ServerInstance->Modules->DoneWithInterface("InspSocketHook"); + ServerInstance->Modules->DoneWithInterface("BufferedSocketHook"); } Version ModuleSpanningTree::GetVersion() diff --git a/src/modules/m_spanningtree/override_stats.cpp b/src/modules/m_spanningtree/override_stats.cpp index d9dca2827..5768ead80 100644 --- a/src/modules/m_spanningtree/override_stats.cpp +++ b/src/modules/m_spanningtree/override_stats.cpp @@ -88,7 +88,7 @@ int ModuleSpanningTree::OnStats(char statschar, User* user, string_list &results std::string transport("plaintext"); if (Utils->Bindings[i]->GetHook()) - transport = InspSocketNameRequest(this, Utils->Bindings[i]->GetHook()).Send(); + transport = BufferedSocketNameRequest(this, Utils->Bindings[i]->GetHook()).Send(); results.push_back(ConvToStr(ServerInstance->Config->ServerName) + " 249 "+user->nick+" :" + ip + ":" + ConvToStr(Utils->Bindings[i]->port)+ " (server, " + transport + ")"); diff --git a/src/modules/m_spanningtree/resolvers.cpp b/src/modules/m_spanningtree/resolvers.cpp index 7c4282c42..b033b5265 100644 --- a/src/modules/m_spanningtree/resolvers.cpp +++ b/src/modules/m_spanningtree/resolvers.cpp @@ -29,7 +29,7 @@ /* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h */ /** This class is used to resolve server hostnames during /connect and autoconnect. - * As of 1.1, the resolver system is seperated out from InspSocket, so we must do this + * As of 1.1, the resolver system is seperated out from BufferedSocket, so we must do this * resolver step first ourselves if we need it. This is totally nonblocking, and will * callback to OnLookupComplete or OnError when completed. Once it has completed we * will have an IP address which we can then use to continue our connection. @@ -45,7 +45,7 @@ void ServernameResolver::OnLookupComplete(const std::string &result, unsigned in return; /* Initiate the connection, now that we have an IP to use. - * Passing a hostname directly to InspSocket causes it to + * Passing a hostname directly to BufferedSocket causes it to * just bail and set its FD to -1. */ TreeServer* CheckDupe = Utils->FindServer(MyLink.Name.c_str()); diff --git a/src/modules/m_spanningtree/resolvers.h b/src/modules/m_spanningtree/resolvers.h index 4549c8551..d1e5d1a5b 100644 --- a/src/modules/m_spanningtree/resolvers.h +++ b/src/modules/m_spanningtree/resolvers.h @@ -60,7 +60,7 @@ class SecurityIPResolver : public Resolver }; /** This class is used to resolve server hostnames during /connect and autoconnect. - * As of 1.1, the resolver system is seperated out from InspSocket, so we must do this + * As of 1.1, the resolver system is seperated out from BufferedSocket, so we must do this * resolver step first ourselves if we need it. This is totally nonblocking, and will * callback to OnLookupComplete or OnError when completed. Once it has completed we * will have an IP address which we can then use to continue our connection. diff --git a/src/modules/m_spanningtree/treesocket.h b/src/modules/m_spanningtree/treesocket.h index 08e308dfb..ba0a04c3a 100644 --- a/src/modules/m_spanningtree/treesocket.h +++ b/src/modules/m_spanningtree/treesocket.h @@ -62,7 +62,7 @@ enum ServerState { LISTENER, CONNECTING, WAIT_AUTH_1, WAIT_AUTH_2, CONNECTED }; /** Every SERVER connection inbound or outbound is represented by * an object of type TreeSocket. - * TreeSockets, being inherited from InspSocket, can be tied into + * TreeSockets, being inherited from BufferedSocket, can be tied into * the core socket engine, and we cn therefore receive activity events * for them, just like activex objects on speed. (yes really, that * is a technical term!) Each of these which relates to a locally @@ -71,7 +71,7 @@ enum ServerState { LISTENER, CONNECTING, WAIT_AUTH_1, WAIT_AUTH_2, CONNECTED }; * maintain a list of servers, some of which are directly connected, * some of which are not. */ -class TreeSocket : public InspSocket +class TreeSocket : public BufferedSocket { SpanningTreeUtilities* Utils; /* Utility class */ std::string myhost; /* Canonical hostname */ @@ -96,14 +96,14 @@ class TreeSocket : public InspSocket public: /** Because most of the I/O gubbins are encapsulated within - * InspSocket, we just call the superclass constructor for + * BufferedSocket, we just call the superclass constructor for * most of the action, and append a few of our own values * to it. */ TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, Module* HookMod = NULL); /** Because most of the I/O gubbins are encapsulated within - * InspSocket, we just call the superclass constructor for + * BufferedSocket, we just call the superclass constructor for * most of the action, and append a few of our own values * to it. */ @@ -166,7 +166,7 @@ class TreeSocket : public InspSocket /** Handle socket error event */ - virtual void OnError(InspSocketError e); + virtual void OnError(BufferedSocketError e); /** Sends an error to the remote server, and displays it locally to show * that it was sent. @@ -257,7 +257,7 @@ class TreeSocket : public InspSocket /** 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 InspSocket::Read() which can + * 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 diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 4f6dae56a..d9d44733d 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -33,30 +33,30 @@ /** Because most of the I/O gubbins are encapsulated within - * InspSocket, we just call the superclass constructor for + * BufferedSocket, we just call the superclass constructor for * most of the action, and append a few of our own values * to it. */ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, Module* HookMod) - : InspSocket(SI, host, port, listening, maxtime), Utils(Util), Hook(HookMod) + : BufferedSocket(SI, host, port, listening, maxtime), Utils(Util), Hook(HookMod) { myhost = host; this->LinkState = LISTENER; theirchallenge.clear(); ourchallenge.clear(); if (listening && Hook) - InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); + BufferedSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); } TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string host, int port, bool listening, unsigned long maxtime, const std::string &ServerName, const std::string &bindto, Module* HookMod) - : InspSocket(SI, host, port, listening, maxtime, bindto), Utils(Util), Hook(HookMod) + : BufferedSocket(SI, host, port, listening, maxtime, bindto), Utils(Util), Hook(HookMod) { myhost = ServerName; theirchallenge.clear(); ourchallenge.clear(); this->LinkState = CONNECTING; if (Hook) - InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); + BufferedSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); } /** When a listening socket gives us a new file descriptor, @@ -64,7 +64,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string ho * connection. This constructor is used for this purpose. */ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, char* ip, Module* HookMod) - : InspSocket(SI, newfd, ip), Utils(Util), Hook(HookMod) + : BufferedSocket(SI, newfd, ip), Utils(Util), Hook(HookMod) { this->LinkState = WAIT_AUTH_1; theirchallenge.clear(); @@ -74,7 +74,7 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, cha * socket, and set a timer waiting for handshake before we send CAPAB etc. */ if (Hook) - InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); + BufferedSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); Instance->Timers->AddTimer(new HandshakeTimer(Instance, this, &(Utils->LinkBlocks[0]), this->Utils, 1)); } @@ -92,7 +92,7 @@ Module* TreeSocket::GetHook() TreeSocket::~TreeSocket() { if (Hook) - InspSocketUnhookRequest(this, (Module*)Utils->Creator, Hook).Send(); + BufferedSocketUnhookRequest(this, (Module*)Utils->Creator, Hook).Send(); Utils->DelBurstingServer(this); } @@ -179,7 +179,7 @@ bool TreeSocket::OnConnected() Utils->Creator->RemoteMessage(NULL,"Connection to \2%s\2[%s] started.", myhost.c_str(), (x->HiddenFromStats ? "<hidden>" : this->GetIP().c_str())); if (Hook) { - InspSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); + BufferedSocketHookRequest(this, (Module*)Utils->Creator, Hook).Send(); Utils->Creator->RemoteMessage(NULL,"Connection to \2%s\2[%s] using transport \2%s\2", myhost.c_str(), (x->HiddenFromStats ? "<hidden>" : this->GetIP().c_str()), x->Hook.c_str()); } @@ -205,7 +205,7 @@ bool TreeSocket::OnConnected() return true; } -void TreeSocket::OnError(InspSocketError e) +void TreeSocket::OnError(BufferedSocketError e) { Link* MyLink; @@ -1358,7 +1358,7 @@ void TreeSocket::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 InspSocket::Read() which can + * 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 diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index 0c2e99041..01e1316f5 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -1015,7 +1015,7 @@ bool TreeSocket::Inbound_Server(std::deque<std::string> ¶ms) this->Instance->SNO->WriteToSnoMask('l',"Verified incoming server connection from \002"+sname+"\002["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] ("+description+")"); if (this->Hook) { - std::string name = InspSocketNameRequest((Module*)Utils->Creator, this->Hook).Send(); + std::string name = BufferedSocketNameRequest((Module*)Utils->Creator, this->Hook).Send(); this->Instance->SNO->WriteToSnoMask('l',"Connection from \2"+sname+"\2["+(x->HiddenFromStats ? "<hidden>" : this->GetIP())+"] using transport \2"+name+"\2"); } diff --git a/src/modules/m_spanningtree/utils.cpp b/src/modules/m_spanningtree/utils.cpp index 4814013e6..0376ea0c2 100644 --- a/src/modules/m_spanningtree/utils.cpp +++ b/src/modules/m_spanningtree/utils.cpp @@ -181,7 +181,7 @@ SpanningTreeUtilities::SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningT this->TreeRoot = new TreeServer(this, ServerInstance, ServerInstance->Config->ServerName, ServerInstance->Config->ServerDesc, ServerInstance->Config->GetSID()); - modulelist* ml = ServerInstance->Modules->FindInterface("InspSocketHook"); + modulelist* ml = ServerInstance->Modules->FindInterface("BufferedSocketHook"); /* Did we find any modules? */ if (ml) @@ -190,9 +190,9 @@ SpanningTreeUtilities::SpanningTreeUtilities(InspIRCd* Instance, ModuleSpanningT for (modulelist::iterator m = ml->begin(); m != ml->end(); m++) { /* Make a request to it for its name, its implementing - * InspSocketHook so we know its safe to do this + * BufferedSocketHook so we know its safe to do this */ - std::string name = InspSocketNameRequest((Module*)Creator, *m).Send(); + std::string name = BufferedSocketNameRequest((Module*)Creator, *m).Send(); /* Build a map of them */ hooks[name.c_str()] = *m; hooknames.push_back(name); @@ -220,7 +220,7 @@ SpanningTreeUtilities::~SpanningTreeUtilities() } } delete TreeRoot; - ServerInstance->InspSocketCull(); + ServerInstance->BufferedSocketCull(); } void SpanningTreeUtilities::AddThisServer(TreeServer* server, TreeServerList &list) diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index aeb89c6be..38ddba0ed 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -33,7 +33,7 @@ typedef nspace::hash_map<std::string, TreeServer*, nspace::hash<string>, irc::St typedef std::map<TreeServer*,TreeServer*> TreeServerList; -/** A group of modules that implement InspSocketHook +/** A group of modules that implement BufferedSocketHook * that we can use to hook our server to server connections. */ typedef std::map<irc::string, Module*> hookmodules; |