]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/afp_dsi.c
Add a configurable hold time option to FCE file modification event generation, defaul...
[netatalk.git] / etc / afpd / afp_dsi.c
index 0e9a21640ef303a656bdb0b0851eac686f44aa14..295e03df7d8dcbc7b9249f34b726b6724831269b 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);
@@ -500,18 +500,27 @@ void afp_over_dsi(AFPObj *obj)
                 exit(0);
             }
 
+#if 0
             /*  got ECONNRESET in read from client => exit*/
             if (dsi->flags & DSI_GOT_ECONNRESET) {
                 LOG(log_note, logtype_afpd, "afp_over_dsi: client connection reset");
                 afp_dsi_close(obj);
                 exit(0);
             }
+#endif
+
+            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);
 
-            pause(); /* gets interrupted by SIGALARM or SIGURG tickle */
+            while (dsi->flags & DSI_DISCONNECTED)
+                pause(); /* gets interrupted by SIGALARM or SIGURG tickle */
             continue; /* continue receiving until disconnect timer expires
                        * or a primary reconnect succeeds  */
         }
@@ -688,7 +697,7 @@ void afp_over_dsi(AFPObj *obj)
         }
         pending_request(dsi);
 
-        vol_fce_tm_event();
+        fce_pending_events(obj);
     }
 
     /* error */