Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] Re: (PR#10994) auth fail and disconnect causes a segfault
Home

[Freeciv-Dev] Re: (PR#10994) auth fail and disconnect causes a segfault

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] Re: (PR#10994) auth fail and disconnect causes a segfault
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 12 Nov 2004 19:45:25 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10994 >

better patch, thx jason.

-mike

Index: server/sernet.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/sernet.c,v
retrieving revision 1.123.2.1
diff -u -r1.123.2.1 sernet.c
--- server/sernet.c     21 Oct 2004 20:26:59 -0000      1.123.2.1
+++ server/sernet.c     13 Nov 2004 03:44:54 -0000
@@ -427,11 +427,7 @@
       /* send data about the previous run */
       send_ping_times_to_all();
 
-      conn_list_iterate(game.game_connections, pconn) {
-       if (!pconn->used) {
-         continue;
-       }
-
+      conn_list_iterate(game.all_connections, pconn) {
        if ((timer_list_size(pconn->server.ping_timers) > 0
             &&
             read_timer_seconds(timer_list_get(pconn->server.ping_timers, 0))
@@ -454,15 +450,13 @@
     }
 
     /* if we've waited long enough after a failure, respond to the client */
-    for (i = 0; i < MAX_NUM_CONNECTIONS; i++) {
-      struct connection *pconn = &connections[i];
-
+    conn_list_iterate(game.all_connections, pconn) {
       if (pconn->server.status == AS_FAILED
           && pconn->server.authentication_stop > 0
           && time(NULL) >= pconn->server.authentication_stop) {
         unfail_authentication(pconn);
       }
-    }
+    } conn_list_iterate_end
 
     /* Don't wait if timeout == -1 (i.e. on auto games) */
     if (server_state != PRE_GAME_STATE && game.timeout == -1) {

[Prev in Thread] Current Thread [Next in Thread]