Skip to content
Snippets Groups Projects
Commit 02297d1a authored by Randy Sommerfeld's avatar Randy Sommerfeld
Browse files

Don't auto-connect to an invalid port. Reported by nelgin, thanks!

parent e53c5926
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -270,17 +270,28 @@ function handle_outbound_server_connect() { ...@@ -270,17 +270,28 @@ function handle_outbound_server_connect() {
Unregistered[id].server = true; /* Avoid recvq limitation */ Unregistered[id].server = true; /* Avoid recvq limitation */
Unregistered[id].ircclass = this.cline.ircclass; Unregistered[id].ircclass = this.cline.ircclass;
this.callback_id = this.on("read", Socket_Recv); this.callback_id = this.on("read", Socket_Recv);
} else { return true;
}
if (YLines[this.cline.ircclass].connfreq > 0 && parseInt(this.cline.port) > 0) {
umode_notice(USERMODE_ROUTING,"Routing",format( umode_notice(USERMODE_ROUTING,"Routing",format(
"Failed to connect to %s (%s). Trying again in %d seconds.", "Failed to connect to %s (%s). Trying again in %d seconds.",
this.cline.servername, this.cline.servername,
this.cline.host, this.cline.host,
YLines[this.cline.ircclass].connfreq YLines[this.cline.ircclass].connfreq
)); ));
this.close();
Reset_Autoconnect(this.cline, YLines[this.cline.ircclass].connfreq * 1000); Reset_Autoconnect(this.cline, YLines[this.cline.ircclass].connfreq * 1000);
} else {
umode_notice(USERMODE_ROUTING,"Routing",format(
"Failed to connect to %s (%s).",
this.cline.servername,
this.cline.host
));
} }
this.cline.lastconnect = system.timer;
this.close();
return false;
} }
function Write_All_Opers(str) { function Write_All_Opers(str) {
...@@ -2882,8 +2893,7 @@ function CLine(host,password,servername,port,ircclass) { ...@@ -2882,8 +2893,7 @@ function CLine(host,password,servername,port,ircclass) {
this.servername = servername; this.servername = servername;
this.port = port; this.port = port;
this.ircclass = ircclass; this.ircclass = ircclass;
this.lastconnect = 0; if (YLines[ircclass].connfreq > 0 && parseInt(port) > 0)
if (YLines[ircclass].connfreq > 0)
Reset_Autoconnect(this, 1 /* connect immediately */); Reset_Autoconnect(this, 1 /* connect immediately */);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment