From: phk Date: Thu, 6 Apr 2006 09:09:58 +0000 (+0000) Subject: Prune the bits we used from the input buffer before we recycle the X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ccb548ac33356e8d3d3135fbede190cd7fd8998;p=varnish Prune the bits we used from the input buffer before we recycle the session. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@128 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_pass.c b/varnish-cache/bin/varnishd/cache_pass.c index 22d6e46a..6e951835 100644 --- a/varnish-cache/bin/varnishd/cache_pass.c +++ b/varnish-cache/bin/varnishd/cache_pass.c @@ -94,8 +94,16 @@ PassSession(struct worker *w, struct sess *sp) break; } } + assert(cl == 0); } - /* XXX: move remaining input in sp->rcv */ - /* XXX: return session to acceptor */ + if (sp->rcv_len > sp->hdr_end) { + memmove(sp->rcv, sp->rcv + sp->hdr_end, + sp->rcv_len - sp->hdr_end); + sp->rcv_len -= sp->hdr_end; + sp->rcv[sp->rcv_len] = '\0'; + } else { + sp->rcv_len = 0; + sp->rcv[sp->rcv_len] = '\0'; + } }