From da476d7c07376591613486f37e698cb894ac944b Mon Sep 17 00:00:00 2001 From: Frank Lahm Date: Tue, 1 Mar 2011 11:44:36 +0100 Subject: [PATCH] FPzzz tests work again --- etc/afpd/afp_dsi.c | 15 +++++++++++++-- etc/afpd/auth.c | 10 ++++++++-- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 375891aa..134fa601 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -280,7 +280,17 @@ static void alarm_handler(int sig _U_) } dsi->tickle++; - LOG(log_note, logtype_afpd, "afp_alarm: tickle count: %i", dsi->tickle); + LOG(log_maxdebug, logtype_afpd, "alarm: tickles: %u, flags: %s|%s|%s|%s|%s|%s|%s|%s|%s", + dsi->tickle, + (dsi->flags & DSI_DATA) ? "DSI_DATA" : "-", + (dsi->flags & DSI_RUNNING) ? "DSI_RUNNING" : "-", + (dsi->flags & DSI_SLEEPING) ? "DSI_SLEEPING" : "-", + (dsi->flags & DSI_EXTSLEEP) ? "DSI_EXTSLEEP" : "-", + (dsi->flags & DSI_DISCONNECTED) ? "DSI_DISCONNECTED" : "-", + (dsi->flags & DSI_DIE) ? "DSI_DIE" : "-", + (dsi->flags & DSI_NOREPLY) ? "DSI_NOREPLY" : "-", + (dsi->flags & DSI_RECONSOCKET) ? "DSI_RECONSOCKET" : "-", + (dsi->flags & DSI_RECONINPROG) ? "DSI_RECONINPROG" : "-"); if (dsi->flags & DSI_SLEEPING) { if (dsi->tickle > AFPobj->options.sleep) { @@ -485,7 +495,8 @@ void afp_over_dsi(AFPObj *obj) } } - if (!dsi->flags & DSI_EXTSLEEP) { + if (!(dsi->flags & DSI_EXTSLEEP)) { + LOG(log_debug, logtype_afpd, "afp_over_dsi: got data, ending normal sleep"); dsi->flags &= ~DSI_SLEEPING; dsi->tickle = 0; } diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index f6082fad..cd2f73f3 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -456,13 +456,19 @@ int afp_zzz(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbu if (data & AFPZZZ_EXT_WAKEUP) { /* wakeup request from exetended sleep */ - if (dsi->flags & DSI_EXTSLEEP) + if (dsi->flags & DSI_EXTSLEEP) { + LOG(log_debug, logtype_afpd, "afp_zzz: waking up from extended sleep"); dsi->flags &= ~(DSI_SLEEPING | DSI_EXTSLEEP); + } } else { /* sleep request */ dsi->flags |= DSI_SLEEPING; - if (data & AFPZZZ_EXT_SLEEP) + if (data & AFPZZZ_EXT_SLEEP) { + LOG(log_debug, logtype_afpd, "afp_zzz: entering extended sleep"); dsi->flags |= DSI_EXTSLEEP; + } else { + LOG(log_debug, logtype_afpd, "afp_zzz: entering normal sleep"); + } } /* * According to AFP 3.3 spec we should not return anything, -- 2.39.2