Commit 023fcb9c authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Pass fd to shmemlog


git-svn-id: http://www.varnish-cache.org/svn/trunk@253 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2fabe618
......@@ -174,7 +174,7 @@ int http_GetTail(struct http *hp, unsigned len, char **b, char **e);
int http_GetURL(struct http *hp, char **b);
void http_RecvHead(struct http *hp, int fd, struct event_base *eb, http_callback_f *func, void *arg);
void http_Dissect(struct http *sp, int fd, int rr);
void http_BuildSbuf(int resp, struct sbuf *sb, struct http *hp);
void http_BuildSbuf(int fd, int resp, struct sbuf *sb, struct http *hp);
/* cache_main.c */
extern pthread_mutex_t sessmtx;
......
......@@ -243,7 +243,7 @@ FetchSession(struct worker *w, struct sess *sp)
VSL(SLT_Backend, sp->fd, "%d %s", fd, sp->backend->vcl_name);
hp = http_New();
http_BuildSbuf(1, w->sb, sp->http);
http_BuildSbuf(fd, 1, w->sb, sp->http);
i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
assert(i == sbuf_len(w->sb));
time(&t_req);
......@@ -262,7 +262,7 @@ FetchSession(struct worker *w, struct sess *sp)
switch (http_GetStatus(hp)) {
case 200:
case 301:
http_BuildSbuf(3, w->sb, hp);
http_BuildSbuf(sp->fd, 3, w->sb, hp);
/* XXX: fill in object from headers */
sp->obj->valid = 1;
sp->obj->cacheable = 1;
......@@ -270,7 +270,7 @@ FetchSession(struct worker *w, struct sess *sp)
body = 1;
break;
case 304:
http_BuildSbuf(3, w->sb, hp);
http_BuildSbuf(sp->fd, 3, w->sb, hp);
/* XXX: fill in object from headers */
sp->obj->valid = 1;
sp->obj->cacheable = 1;
......@@ -305,7 +305,7 @@ FetchSession(struct worker *w, struct sess *sp)
} else
cls = 0;
http_BuildSbuf(2, w->sb, hp);
http_BuildSbuf(sp->fd, 2, w->sb, hp);
vca_write_obj(sp, w->sb);
......
......@@ -391,7 +391,7 @@ http_supress(const char *hdr, int flag)
/*--------------------------------------------------------------------*/
void
http_BuildSbuf(int resp, struct sbuf *sb, struct http *hp)
http_BuildSbuf(int fd, int resp, struct sbuf *sb, struct http *hp)
{
unsigned u;
......@@ -419,7 +419,7 @@ http_BuildSbuf(int resp, struct sbuf *sb, struct http *hp)
if (http_supress(hp->hdr[u], resp))
continue;
if (1)
VSL(SLT_Debug, 0, "Build %s", hp->hdr[u]);
VSL(SLT_BldHdr, fd, "%s", hp->hdr[u]);
sbuf_cat(sb, hp->hdr[u]);
sbuf_cat(sb, "\r\n");
}
......
......@@ -160,7 +160,7 @@ PassSession(struct worker *w, struct sess *sp)
fd = VBE_GetFd(sp->backend, &fd_token);
assert(fd != -1);
http_BuildSbuf(1, w->sb, sp->http);
http_BuildSbuf(fd, 1, w->sb, sp->http);
i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
assert(i == sbuf_len(w->sb));
......@@ -175,7 +175,7 @@ PassSession(struct worker *w, struct sess *sp)
event_base_loop(w->eb, 0);
http_Dissect(hp, fd, 2);
http_BuildSbuf(2, w->sb, hp);
http_BuildSbuf(sp->fd, 2, w->sb, hp);
vca_write(sp, sbuf_data(w->sb), sbuf_len(w->sb));
if (http_GetHdr(hp, "Content-Length", &b))
......
......@@ -51,7 +51,7 @@ PipeSession(struct worker *w, struct sess *sp)
fd = VBE_GetFd(sp->backend, &fd_token);
assert(fd != -1);
http_BuildSbuf(0, w->sb, sp->http); /* XXX: 0 ?? */
http_BuildSbuf(fd, 0, w->sb, sp->http); /* XXX: 0 ?? */
i = write(fd, sbuf_data(w->sb), sbuf_len(w->sb));
assert(i == sbuf_len(w->sb));
assert(__LINE__ == 0);
......
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