r167 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon May 1 14:59:34 CEST 2006


Author: phk
Date: 2006-05-01 14:59:34 +0200 (Mon, 01 May 2006)
New Revision: 167

Modified:
   trunk/varnish-cache/bin/varnishd/cache_pool.c
Log:
Use vca_write/vca_flush


Modified: trunk/varnish-cache/bin/varnishd/cache_pool.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-05-01 12:59:12 UTC (rev 166)
+++ trunk/varnish-cache/bin/varnishd/cache_pool.c	2006-05-01 12:59:34 UTC (rev 167)
@@ -69,7 +69,6 @@
 DeliverSession(struct worker *w, struct sess *sp)
 {
 	char buf[BUFSIZ];
-	int i, j;
 	struct storage *st;
 
 	sprintf(buf,
@@ -78,13 +77,10 @@
 	    "Content-Length: %u\r\n"
 	    "\r\n", sp->obj->len);
 
-	j = strlen(buf);
-	i = write(sp->fd, buf, j);
-	assert(i == j);
-	TAILQ_FOREACH(st, &sp->obj->store, list) {
-		i = write(sp->fd, st->ptr, st->len);
-		assert(i == st->len);
-	}
+	vca_write(sp, buf, strlen(buf));
+	TAILQ_FOREACH(st, &sp->obj->store, list)
+		vca_write(sp, st->ptr, st->len);
+	vca_flush(sp);
 	return (1);
 }
 
@@ -126,7 +122,6 @@
 		sp->handling = HND_Lookup;
 		
 		sp->vcl->recv_func(sp);
-		sp->handling = HND_Pass;
 
 		for (done = 0; !done; ) {
 			switch(sp->handling) {




More information about the varnish-commit mailing list