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:26:28 -0800
Reply-to: rt@xxxxxxxxxxx

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

and here's a patch to fix the problem in sernet.c

-mike

PS: also pingtimeout should look at all connections. bugfix included.

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:25:42 -0000
@@ -427,7 +427,7 @@
       /* send data about the previous run */
       send_ping_times_to_all();
 
-      conn_list_iterate(game.game_connections, pconn) {
+      conn_list_iterate(game.all_connections, pconn) {
        if (!pconn->used) {
          continue;
        }
@@ -454,15 +454,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]