]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
Changed Handle_Write() to not close sockets itself but to call Conn_Close.
[ngircd-alex.git] / src / ngircd / conf.c
index 979a1a62e76fe95af877581d7e423f00ad5637f4..976d2e0d0f1bcb6f81ab8d8461f4a230b11fbc7f 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "portab.h"
 
-static char UNUSED id[] = "$Id: conf.c,v 1.87 2005/09/24 17:06:54 alex Exp $";
+static char UNUSED id[] = "$Id: conf.c,v 1.88 2005/10/11 19:29:23 alex Exp $";
 
 #include "imp.h"
 #include <assert.h>
@@ -254,6 +254,7 @@ Conf_UnsetServer( CONN_ID Idx )
         * Non-Server-Connections will be silently ignored. */
 
        int i;
+       time_t t;
 
        /* Check all our configured servers */
        for( i = 0; i < MAX_SERVERS; i++ ) {
@@ -267,10 +268,14 @@ Conf_UnsetServer( CONN_ID Idx )
                        Init_Server_Struct( &Conf_Server[i] );
                } else {
                        /* Set time for next connect attempt */
-                       if( Conf_Server[i].lasttry <  time( NULL ) - Conf_ConnectRetry ) {
-                               /* Okay, the connection was established "long enough": */
-                               Conf_Server[i].lasttry = time( NULL ) - Conf_ConnectRetry + RECONNECT_DELAY;
-                       }
+                       t = time(NULL);
+                       if (Conf_Server[i].lasttry < t - Conf_ConnectRetry) {
+                               /* The connection has been "long", so we don't
+                                * require the next attempt to be delayed. */
+                               Conf_Server[i].lasttry =
+                                       t - Conf_ConnectRetry + RECONNECT_DELAY;
+                       } else
+                               Conf_Server[i].lasttry = t;
                }
        }
 } /* Conf_UnsetServer */