From: didg Date: Thu, 22 Oct 2009 07:40:50 +0000 (+0000) Subject: oops, a previous commit wrongly removed this X-Git-Tag: before-ipv6~47 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=a201cc7f428a0dab661a3117fa3b8bf3028329a6;hp=a3bd601ca1822e0757b802234df856660657869e oops, a previous commit wrongly removed this --- diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 9b0baaad..45e62643 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -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);