From 42bddbfc23936836e4a9f0f8202b58920c37eb3b Mon Sep 17 00:00:00 2001 From: phk Date: Wed, 5 Jul 2006 09:32:12 +0000 Subject: [PATCH] Unify logging in the response handling git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@314 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache_acceptor.c | 3 +++ varnish-cache/bin/varnishd/cache_fetch.c | 3 --- varnish-cache/bin/varnishd/cache_pool.c | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 03f290f9..f36a4a2c 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -91,6 +91,9 @@ vca_write_obj(struct sess *sp, char *b, unsigned l) unsigned u = 0; char *r; + VSL(SLT_Response, sp->fd, "%u", sp->obj->response); + VSL(SLT_Length, sp->fd, "%u", sp->obj->len); + if (l == 0) l = strlen(b); vca_write(sp, b, l); diff --git a/varnish-cache/bin/varnishd/cache_fetch.c b/varnish-cache/bin/varnishd/cache_fetch.c index 5a3b8fe0..e27f3097 100644 --- a/varnish-cache/bin/varnishd/cache_fetch.c +++ b/varnish-cache/bin/varnishd/cache_fetch.c @@ -289,9 +289,6 @@ FetchSession(struct worker *w, struct sess *sp) sbuf_finish(w->sb); sp->obj->header = strdup(sbuf_data(w->sb)); - VSL(SLT_Response, sp->fd, "%u", sp->obj->response); - VSL(SLT_Length, sp->fd, "%u", sp->obj->len); - vca_write_obj(sp, sp->obj->header, 0); if (http_GetHdr(hp, "Connection", &b) && !strcasecmp(b, "close")) diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index e733f88f..ae8118be 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -50,8 +50,6 @@ DeliverSession(struct worker *w, struct sess *sp) { - VSL(SLT_Response, sp->fd, "%u", sp->obj->response); - VSL(SLT_Length, sp->fd, "%u", sp->obj->len); vca_write_obj(sp, sp->obj->header, 0); HSH_Deref(sp->obj); sp->obj = NULL; -- 2.39.5