From: phk Date: Tue, 12 Sep 2006 20:17:35 +0000 (+0000) Subject: Fix timestamps in shm tag StatSess for sessions with no requests. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1e6d17b3a9ce90c3f5dc0fa1d6d94b3bdbaa842;p=varnish Fix timestamps in shm tag StatSess for sessions with no requests. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@974 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_center.c b/varnish-cache/bin/varnishd/cache_center.c index fbc970b5..5e5c1ada 100644 --- a/varnish-cache/bin/varnishd/cache_center.c +++ b/varnish-cache/bin/varnishd/cache_center.c @@ -245,27 +245,24 @@ cnt_first(struct sess *sp) SES_RefSrcAddr(sp); for (;;) { i = http_RecvSome(sp->fd, sp->http); - switch (i) { - case -1: + if (i == -1) continue; - case 0: + if (i == 0) { sp->step = STP_RECV; return (0); - case 1: + } + if (i == 1) vca_close_session(sp, "overflow"); - SES_Charge(sp); - vca_return_session(sp); - sp->step = STP_DONE; - return (1); - case 2: + else if (i == 2) vca_close_session(sp, "no request"); - SES_Charge(sp); - vca_return_session(sp); - sp->step = STP_DONE; - return (1); - default: + else INCOMPL(); - } + clock_gettime(CLOCK_REALTIME, &sp->t_end); + sp->wrk->idle = sp->t_end.tv_sec; + SES_Charge(sp); + vca_return_session(sp); + sp->step = STP_DONE; + return (1); } }