]> arthur.barton.de Git - netatalk.git/commitdiff
Fix a problem leading to multiple afpd processes for one user when a primary reconnec...
authorFrank Lahm <franklahm@googlemail.com>
Fri, 22 Jul 2011 12:00:40 +0000 (14:00 +0200)
committerFrank Lahm <franklahm@googlemail.com>
Fri, 22 Jul 2011 12:00:40 +0000 (14:00 +0200)
Fix a problem when sesssion disconnected state was not entered, because the connectivity interruption happened while an AFP command was active.

etc/afpd/afp_dsi.c

index 0e9a21640ef303a656bdb0b0851eac686f44aa14..8fc7c0fb80edd74dc4469f8836b2bea01f5efed0 100644 (file)
@@ -327,7 +327,7 @@ static void alarm_handler(int sig _U_)
     }
 
     /* if we're in the midst of processing something, don't die. */        
-    if ( !(dsi->flags & DSI_RUNNING) && (dsi->tickle >= AFPobj->options.timeout)) {
+    if (dsi->tickle >= AFPobj->options.timeout) {
         LOG(log_error, logtype_afpd, "afp_alarm: child timed out, entering disconnected state");
         if (dsi_disconnect(dsi) != 0)
             afp_dsi_die(EXITERR_CLNT);
@@ -507,6 +507,12 @@ void afp_over_dsi(AFPObj *obj)
                 exit(0);
             }
 
+            if (dsi->flags & DSI_RECONINPROG) {
+                LOG(log_note, logtype_afpd, "afp_over_dsi: failed reconnect");
+                afp_dsi_close(obj);
+                exit(0);
+            }
+
             /* Some error on the client connection, enter disconnected state */
             if (dsi_disconnect(dsi) != 0)
                 afp_dsi_die(EXITERR_CLNT);