Commit 2a0ee121 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Log reponse code and object length


git-svn-id: http://www.varnish-cache.org/svn/trunk@312 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 6c3f79bb
...@@ -60,6 +60,8 @@ struct object { ...@@ -60,6 +60,8 @@ struct object {
unsigned heap_idx; unsigned heap_idx;
unsigned ban_seq; unsigned ban_seq;
unsigned response;
unsigned valid; unsigned valid;
unsigned cacheable; unsigned cacheable;
......
...@@ -63,7 +63,7 @@ fetch_straight(struct worker *w, struct sess *sp, int fd, struct http *hp, char ...@@ -63,7 +63,7 @@ fetch_straight(struct worker *w, struct sess *sp, int fd, struct http *hp, char
while (cl != 0) { while (cl != 0) {
i = read(fd, p, cl); i = read(fd, p, cl);
assert(i > 0); assert(i > 0); /* XXX seen */
p += i; p += i;
cl -= i; cl -= i;
} }
...@@ -245,6 +245,8 @@ FetchSession(struct worker *w, struct sess *sp) ...@@ -245,6 +245,8 @@ FetchSession(struct worker *w, struct sess *sp)
sp->obj->xid = sp->xid; sp->obj->xid = sp->xid;
fd = VBE_GetFd(sp->backend, &fd_token, sp->xid); fd = VBE_GetFd(sp->backend, &fd_token, sp->xid);
if (fd == -1)
fd = VBE_GetFd(sp->backend, &fd_token, sp->xid);
assert(fd != -1); /* XXX: handle this */ assert(fd != -1); /* XXX: handle this */
VSL(SLT_Backend, sp->fd, "%d %s", fd, sp->backend->vcl_name); VSL(SLT_Backend, sp->fd, "%d %s", fd, sp->backend->vcl_name);
...@@ -287,6 +289,9 @@ FetchSession(struct worker *w, struct sess *sp) ...@@ -287,6 +289,9 @@ FetchSession(struct worker *w, struct sess *sp)
sbuf_finish(w->sb); sbuf_finish(w->sb);
sp->obj->header = strdup(sbuf_data(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); vca_write_obj(sp, sp->obj->header, 0);
if (http_GetHdr(hp, "Connection", &b) && !strcasecmp(b, "close")) if (http_GetHdr(hp, "Connection", &b) && !strcasecmp(b, "close"))
......
...@@ -130,7 +130,8 @@ RFC2616_cache_policy(struct sess *sp, struct http *hp) ...@@ -130,7 +130,8 @@ RFC2616_cache_policy(struct sess *sp, struct http *hp)
* Initial cacheability determination per [RFC2616, 13.4] * Initial cacheability determination per [RFC2616, 13.4]
* We do not support ranges yet, so 206 is out. * We do not support ranges yet, so 206 is out.
*/ */
switch (http_GetStatus(hp)) { sp->obj->response = http_GetStatus(hp);
switch (sp->obj->response) {
case 200: /* OK */ case 200: /* OK */
sp->obj->valid = 1; sp->obj->valid = 1;
/* FALLTHROUGH */ /* FALLTHROUGH */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment