]> arthur.barton.de Git - netatalk.git/commitdiff
oops, a previous commit wrongly removed this
authordidg <didg>
Thu, 22 Oct 2009 07:40:50 +0000 (07:40 +0000)
committerdidg <didg>
Thu, 22 Oct 2009 07:40:50 +0000 (07:40 +0000)
etc/afpd/afp_dsi.c

index 9b0baaad042ddebd193e7a867bba3d9d49c7ceb6..45e626431a14f228c6e387bc2d6f80afc0d0695a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_dsi.c,v 1.43 2009-10-22 05:53:20 didg Exp $
+ * $Id: afp_dsi.c,v 1.44 2009-10-22 07:40:50 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -46,6 +46,7 @@
 #define CHILD_DIE         (1 << 0)
 #define CHILD_RUNNING     (1 << 1)
 #define CHILD_SLEEPING    (1 << 2)
+#define CHILD_DATA        (1 << 3)
 
 static struct {
     AFPObj *obj;
@@ -179,6 +180,13 @@ static void alarm_handler(int sig _U_)
      * may use alarm() */
     setitimer(ITIMER_REAL, &dsi->timer, NULL);
 
+    /* we got some traffic from the client since the previous timer 
+     * tick. */
+    if ((child.flags & CHILD_DATA)) {
+        child.flags &= ~CHILD_DATA;
+        return;
+    }
+
     /* if we're in the midst of processing something,
        don't die. */
     if ((child.flags & CHILD_SLEEPING) && child.tickle++ < child.obj->options.sleep) {
@@ -327,6 +335,8 @@ void afp_over_dsi(AFPObj *obj)
             pending_request(dsi);
             continue;
         } 
+
+        child.flags |= CHILD_DATA;
         switch(cmd) {
         case DSIFUNC_CLOSE:
             afp_dsi_close(obj);