]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Move the schedule outside of the if
authorCruicky <redacted>
Tue, 5 Aug 2008 11:37:15 +0000 (12:37 +0100)
committerCruicky <redacted>
Tue, 5 Aug 2008 11:37:15 +0000 (12:37 +0100)
If newserv attempts to connect, and instantly gets a socket error, then no further attempts are made to reconnect due to connected=0

irc/irc.c

index a03ba59105718b9c85c56bf064727211c1973e1b..72c8c8b621ad835177b9666eb317df3e6a3dce05 100644 (file)
--- a/irc/irc.c
+++ b/irc/irc.c
@@ -192,13 +192,12 @@ void irc_disconnected() {
   serverfd=-1;
   if (connected) {
     connected=0;
-    
-    deleteschedule(NULL,&irc_connect,NULL);
-    deleteschedule(NULL,&sendping,NULL);
-    scheduleoneshot(time(NULL)+2,&irc_connect,NULL);
     triggerhook(HOOK_IRC_PRE_DISCON,NULL);
     triggerhook(HOOK_IRC_DISCON,NULL);
   }
+  deleteschedule(NULL,&irc_connect,NULL);
+  deleteschedule(NULL,&sendping,NULL);
+  scheduleoneshot(time(NULL)+2,&irc_connect,NULL);
 }
 
 void irc_send(char *format, ... ) {