capab_phase = 0;
proto_version = 0;
LinkState = CONNECTING;
+ if (!hook.empty())
+ {
+ modulelist* ml = ServerInstance->Modules->FindInterface("BufferedSocketHook");
+ if (ml)
+ {
+ for(modulelist::iterator i = ml->begin(); i != ml->end(); ++i)
+ {
+ std::string name = (**i).ModuleSourceFile;
+ int a = name.rfind('_');
+ int b = name.rfind('.');
+ name = name.substr(a+1, b-a-1);
+ if (name == hook)
+ {
+ AddIOHook(*i);
+ goto found;
+ }
+ }
+ }
+ SetError("Could not find hook '" + hook + "' for connection to " + ServerName);
+ return;
+ }
+found:
DoConnect(shost, iport, maxtime, bindto);
Utils->timeoutlist[this] = std::pair<std::string, int>(ServerName, maxtime);
- // TODO AddIOHook using the given hook
SendCapabilities(1);
}
OutboundPass.clear();
}
-bool TreeSocket::cull()
+CullResult TreeSocket::cull()
{
Utils->timeoutlist.erase(this);
+ if (myautoconnect)
+ Utils->Creator->ConnectServer(myautoconnect, false);
return this->BufferedSocket::cull();
}
{
case I_ERR_CONNECT:
ServerInstance->SNO->WriteToSnoMask('l', "Connection failed: Connection to \002%s\002 refused", myhost.c_str());
- Utils->Creator->ConnectServer(myautoconnect);
break;
case I_ERR_SOCKET:
ServerInstance->SNO->WriteToSnoMask('l', "Connection failed: Could not create socket (%s)", strerror(errno));