From: phk Date: Mon, 1 May 2006 12:59:34 +0000 (+0000) Subject: Use vca_write/vca_flush X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b10233f564b4cf3d7627091720d3e5cde42eba8d;p=varnish Use vca_write/vca_flush git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@167 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 57425cba..32816a41 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -69,7 +69,6 @@ static int DeliverSession(struct worker *w, struct sess *sp) { char buf[BUFSIZ]; - int i, j; struct storage *st; sprintf(buf, @@ -78,13 +77,10 @@ DeliverSession(struct worker *w, struct sess *sp) "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 @@ CacheWorker(void *priv) sp->handling = HND_Lookup; sp->vcl->recv_func(sp); - sp->handling = HND_Pass; for (done = 0; !done; ) { switch(sp->handling) {