aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/m_spanningtree/treesocket1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_spanningtree/treesocket1.cpp')
-rw-r--r--src/modules/m_spanningtree/treesocket1.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp
index 6703021a8..d59364751 100644
--- a/src/modules/m_spanningtree/treesocket1.cpp
+++ b/src/modules/m_spanningtree/treesocket1.cpp
@@ -34,8 +34,8 @@
* most of the action, and append a few of our own values
* to it.
*/
-TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string shost, int iport, unsigned long maxtime, const std::string &ServerName, const std::string &bindto, Module* HookMod)
- : BufferedSocket(SI, shost, iport, maxtime, bindto), Utils(Util), Hook(HookMod)
+TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string shost, int iport, unsigned long maxtime, const std::string &ServerName, const std::string &bindto, Autoconnect* myac, Module* HookMod)
+ : BufferedSocket(SI, shost, iport, maxtime, bindto), Utils(Util), Hook(HookMod), myautoconnect(myac)
{
age = SI->Time();
myhost = ServerName;
@@ -52,8 +52,8 @@ TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, std::string sh
* we must associate it with a socket without creating a new
* connection. This constructor is used for this purpose.
*/
-TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, char* ip, Module* HookMod)
- : BufferedSocket(SI, newfd, ip), Utils(Util), Hook(HookMod)
+TreeSocket::TreeSocket(SpanningTreeUtilities* Util, InspIRCd* SI, int newfd, char* ip, Autoconnect* myac, Module* HookMod)
+ : BufferedSocket(SI, newfd, ip), Utils(Util), Hook(HookMod), myautoconnect(myac)
{
age = SI->Time();
LinkState = WAIT_AUTH_1;
@@ -149,15 +149,11 @@ bool TreeSocket::OnConnected()
void TreeSocket::OnError(BufferedSocketError e)
{
- Link* MyLink;
-
switch (e)
{
case I_ERR_CONNECT:
ServerInstance->SNO->WriteToSnoMask('l', "Connection failed: Connection to \002%s\002 refused", myhost.c_str());
- MyLink = Utils->FindLink(myhost);
- if (MyLink)
- Utils->DoFailOver(MyLink);
+ Utils->DoFailOver(myautoconnect);
break;
case I_ERR_SOCKET:
ServerInstance->SNO->WriteToSnoMask('l', "Connection failed: Could not create socket (%s)", strerror(errno));