r128 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Thu Apr 6 11:09:58 CEST 2006


Author: phk
Date: 2006-04-06 11:09:58 +0200 (Thu, 06 Apr 2006)
New Revision: 128

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pass.c
Log:
Prune the bits we used from the input buffer before we recycle the
session.


Modified: trunk/varnish-cache/bin/varnishd/cache_pass.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-04-06 09:09:09 UTC (rev 127)
+++ trunk/varnish-cache/bin/varnishd/cache_pass.c	2006-04-06 09:09:58 UTC (rev 128)
@@ -94,8 +94,16 @@
 				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';
+	}
 }




More information about the varnish-commit mailing list