]> err.no Git - varnish/commitdiff
Prune the bits we used from the input buffer before we recycle the
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 6 Apr 2006 09:09:58 +0000 (09:09 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Thu, 6 Apr 2006 09:09:58 +0000 (09:09 +0000)
session.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@128 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_pass.c

index 22d6e46a583f8ed67f0c81d351d48360f6f15421..6e951835ab896106e4b05dcb713b839e24f45df9 100644 (file)
@@ -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';
+       }
 }