]> arthur.barton.de Git - netatalk.git/commitdiff
Fix idle connection disconnects
authorFrank Lahm <franklahm@googlemail.com>
Tue, 8 Mar 2011 11:20:00 +0000 (12:20 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Tue, 8 Mar 2011 11:20:00 +0000 (12:20 +0100)
NEWS
VERSION
etc/afpd/afp_dsi.c

diff --git a/NEWS b/NEWS
index 78791dc2e00062749f70aaba8b0ebe11c60bc33b..13d0b4940f944c46ecfec710a3db65b80ca1e69d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,9 @@
-Changes in 2.2
-==============
+Changes in 2.2beta3
+===================
 
 * FIX: afpd: fix option volsizelimit to return a usefull value for the
        volume free space using `du -sh` with popen
+* FIX: afpd: fix idle connection disconnects
 
 Changes in 2.2beta2
 ====================
diff --git a/VERSION b/VERSION
index 616187889b6f131b13f30fcddddc92c8d1ac1198..6958a38708843810d7fa0b4212672e294067c634 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.2
\ No newline at end of file
+2.2-beta3
\ No newline at end of file
index 64ff4be02d44993e7e50ab9f88cfd6f3bf3f8580..e522ea817d6178b39b8eb40bcb37c780f82038fa 100644 (file)
@@ -292,7 +292,7 @@ static void alarm_handler(int sig _U_)
 
     if (dsi->flags & DSI_DISCONNECTED) {
         if (dsi->tickle > AFPobj->options.disconnected) {
-             LOG(log_error, logtype_afpd, "afp_alarm: no reconnect within 10 minutes, goodbye");
+            LOG(log_error, logtype_afpd, "afp_alarm: no reconnect within 10 minutes, goodbye");
             afp_dsi_die(EXITERR_CLNT);
         }
         return;
@@ -307,9 +307,11 @@ static void alarm_handler(int sig _U_)
     }
 
     if ((err = pollvoltime(AFPobj)) == 0)
+        LOG(log_debug, logtype_afpd, "afp_alarm: sending DSI tickle");
         err = dsi_tickle(AFPobj->handle);
     if (err <= 0) {
         LOG(log_error, logtype_afpd, "afp_alarm: connection problem, entering disconnected state");
+        dsi->proto_close(dsi);
         dsi->flags |= DSI_DISCONNECTED;
     }
 }
@@ -510,20 +512,23 @@ void afp_over_dsi(AFPObj *obj)
             }
         }
 
-        if (cmd == DSIFUNC_TICKLE) {
-            /* timer is not every 30 seconds anymore, so we don't get killed on the client side. */
-            if ((dsi->flags & DSI_DIE))
-                dsi_tickle(dsi);
-            pending_request(dsi);
-            continue;
-        } 
 
         dsi->flags |= DSI_DATA;
+        dsi->tickle = 0;
+
         switch(cmd) {
+
         case DSIFUNC_CLOSE:
             afp_dsi_close(obj);
             LOG(log_note, logtype_afpd, "done");
             return;
+
+        case DSIFUNC_TICKLE:
+            dsi->flags &= ~DSI_DATA; /* thats no data in the sense we use it in alarm_handler */
+            LOG(log_debug, logtype_afpd, "DSI client tickle");
+            /* timer is not every 30 seconds anymore, so we don't get killed on the client side. */
+            if ((dsi->flags & DSI_DIE))
+                dsi_tickle(dsi);
             break;
 
         case DSIFUNC_CMD: