]> err.no Git - varnish/commitdiff
Pass fd to shmemlog
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 28 Jun 2006 16:20:14 +0000 (16:20 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 28 Jun 2006 16:20:14 +0000 (16:20 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@253 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_fetch.c
varnish-cache/bin/varnishd/cache_http.c
varnish-cache/bin/varnishd/cache_pass.c
varnish-cache/bin/varnishd/cache_pipe.c

index e2bf5fea56e40ba6f8d5b6d38d52b16cd528287a..8425d9b1145af38bbcba0e1e7e6dbc536879e785 100644 (file)
@@ -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;
index 06aed1c26b5e216996c485940d524c77bdf8986e..1d1dff9b6aa04f77b9d48cfe949aabb7aa4d6e3e 100644 (file)
@@ -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);
 
index b55977bc190d52a0756a949a82d8953b3540690f..01352f86c7350950c6e90af2aa8894b61973fab9 100644 (file)
@@ -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");
        }
index 6ea20253bad2462b3c04fb5327578cd9feeebfcf..01ef5af3951ac812895fb74ca0d27dbf2e576573 100644 (file)
@@ -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))
index 3a5dc02a960fd83253a923b65e7c8ccc0b3b1cf8..68866fc1f36abd15a3bb074bc5ddbab1fecb5104 100644 (file)
@@ -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);