]> err.no Git - varnish/commitdiff
Rename the backend connections two http's "bereq" and "beresp"
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 3 Jul 2007 08:11:17 +0000 (08:11 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 3 Jul 2007 08:11:17 +0000 (08:11 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1621 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_backend.c
varnish-cache/bin/varnishd/cache_fetch.c
varnish-cache/bin/varnishd/cache_pipe.c

index 3617b3f6952284b20f83e54572da2e8ac71b0d79..abf11e5f339893b2c107a3d9266b3614746966b6 100644 (file)
@@ -185,8 +185,8 @@ struct vbe_conn {
        TAILQ_ENTRY(vbe_conn)   list;
        struct backend          *backend;
        int                     fd;
-       struct http             *http;
-       struct http             *http2;
+       struct http             *bereq;
+       struct http             *beresp;
        struct http             http_mem[2];
 };
 
index 050e258853b371e3a0f10ebea67f3c9d78008fa1..948d1b2dc4ef881ef4bab55e8b709d7c8aeb8d98 100644 (file)
@@ -89,13 +89,13 @@ vbe_new_conn(void)
                return (NULL);
        VSL_stats->n_vbe_conn++;
        vbc->magic = VBE_CONN_MAGIC;
-       vbc->http = &vbc->http_mem[0];
-       vbc->http2 = &vbc->http_mem[1];
+       vbc->bereq = &vbc->http_mem[0];
+       vbc->beresp = &vbc->http_mem[1];
        vbc->fd = -1;
        p = (void *)(vbc + 1);
-       http_Setup(vbc->http, p, space);
+       http_Setup(vbc->bereq, p, space);
        p += space;
-       http_Setup(vbc->http2, p, space);
+       http_Setup(vbc->beresp, p, space);
        return (vbc);
 }
 
@@ -337,8 +337,8 @@ VBE_ClosedFd(struct worker *w, struct vbe_conn *vc, int already)
                AZ(close(vc->fd));
        vc->fd = -1;
        vc->backend = NULL;
-       WS_Reset(vc->http->ws);
-       WS_Reset(vc->http2->ws);
+       WS_Reset(vc->bereq->ws);
+       WS_Reset(vc->beresp->ws);
        LOCK(&vbemtx);
        TAILQ_INSERT_HEAD(&vbe_head, vc, list);
        VSL_stats->backend_unused++;
@@ -355,8 +355,8 @@ VBE_RecycleFd(struct worker *w, struct vbe_conn *vc)
        assert(vc->fd >= 0);
        AN(vc->backend);
        WSL(w, SLT_BackendReuse, vc->fd, "%s", vc->backend->vcl_name);
-       WS_Reset(vc->http->ws);
-       WS_Reset(vc->http2->ws);
+       WS_Reset(vc->bereq->ws);
+       WS_Reset(vc->beresp->ws);
        LOCK(&vbemtx);
        VSL_stats->backend_recycle++;
        TAILQ_INSERT_HEAD(&vc->backend->connlist, vc, list);
index d9f73a8f05079e4adb7a991510f57c5ba43acb67..327d094d5d268f797b6168e576224a8e5092d8ac 100644 (file)
@@ -275,20 +275,20 @@ Fetch(struct sess *sp)
        if (vc == NULL)
                return (1);
 
-       http_ClrHeader(vc->http);
-       vc->http->logtag = HTTP_Tx;
-       http_GetReq(w, vc->fd, vc->http, sp->http);
-       http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_FETCH);
-       http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
-       http_PrintfHeader(w, vc->fd, vc->http,
+       http_ClrHeader(vc->bereq);
+       vc->bereq->logtag = HTTP_Tx;
+       http_GetReq(w, vc->fd, vc->bereq, sp->http);
+       http_FilterHeader(w, vc->fd, vc->bereq, sp->http, HTTPH_R_FETCH);
+       http_PrintfHeader(w, vc->fd, vc->bereq, "X-Varnish: %u", sp->xid);
+       http_PrintfHeader(w, vc->fd, vc->bereq,
            "X-Forwarded-for: %s", sp->addr);
-       if (!http_GetHdr(vc->http, H_Host, &b)) {
-               http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+       if (!http_GetHdr(vc->bereq, H_Host, &b)) {
+               http_PrintfHeader(w, vc->fd, vc->bereq, "Host: %s",
                    sp->backend->hostname);
        }
 
        WRK_Reset(w, &vc->fd);
-       http_Write(w, vc->http, 0);
+       http_Write(w, vc->bereq, 0);
        if (WRK_Flush(w)) {
                /* XXX: cleanup */
                return (1);
@@ -298,11 +298,11 @@ Fetch(struct sess *sp)
        CHECK_OBJ_NOTNULL(sp->wrk, WORKER_MAGIC);
        CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC);
 
-       if (http_RecvHead(vc->http, vc->fd)) {
+       if (http_RecvHead(vc->bereq, vc->fd)) {
                /* XXX: cleanup */
                return (1);
        }
-       if (http_DissectResponse(sp->wrk, vc->http, vc->fd)) {
+       if (http_DissectResponse(sp->wrk, vc->bereq, vc->fd)) {
                /* XXX: cleanup */
                return (1);
        }
@@ -315,22 +315,22 @@ Fetch(struct sess *sp)
 
        assert(sp->obj->busy != 0);
 
-       if (http_GetHdr(vc->http, H_Last_Modified, &b))
+       if (http_GetHdr(vc->bereq, H_Last_Modified, &b))
                sp->obj->last_modified = TIM_parse(b);
 
-       hp = vc->http2;
+       hp = vc->beresp;
        http_ClrHeader(hp);
        hp->logtag = HTTP_Obj;
-       http_CopyResp(sp->wrk, sp->fd, hp, vc->http);
-       http_FilterHeader(sp->wrk, sp->fd, hp, vc->http, HTTPH_A_INS);
+       http_CopyResp(sp->wrk, sp->fd, hp, vc->bereq);
+       http_FilterHeader(sp->wrk, sp->fd, hp, vc->bereq, HTTPH_A_INS);
 
        if (body) {
-               if (http_GetHdr(vc->http, H_Content_Length, &b))
-                       cls = fetch_straight(sp, vc->fd, vc->http, b);
-               else if (http_HdrIs(vc->http, H_Transfer_Encoding, "chunked"))
-                       cls = fetch_chunked(sp, vc->fd, vc->http);
+               if (http_GetHdr(vc->bereq, H_Content_Length, &b))
+                       cls = fetch_straight(sp, vc->fd, vc->bereq, b);
+               else if (http_HdrIs(vc->bereq, H_Transfer_Encoding, "chunked"))
+                       cls = fetch_chunked(sp, vc->fd, vc->bereq);
                else
-                       cls = fetch_eof(sp, vc->fd, vc->http);
+                       cls = fetch_eof(sp, vc->fd, vc->bereq);
                http_PrintfHeader(sp->wrk, sp->fd, hp,
                    "Content-Length: %u", sp->obj->len);
        } else
@@ -359,7 +359,7 @@ Fetch(struct sess *sp)
 
        http_CopyHttp(&sp->obj->http, hp);
 
-       if (http_GetHdr(vc->http, H_Connection, &b) && !strcasecmp(b, "close"))
+       if (http_GetHdr(vc->bereq, H_Connection, &b) && !strcasecmp(b, "close"))
                cls = 1;
 
        if (cls)
index 5ced37ba2e362418de8be29b0da7af93c44a9ef2..23af9c004de24211205b6ea8dc54b6cc9118ea02 100644 (file)
@@ -87,19 +87,19 @@ PipeSession(struct sess *sp)
        vc = VBE_GetFd(sp);
        if (vc == NULL)
                return;
-       vc->http->logtag = HTTP_Tx;
+       vc->bereq->logtag = HTTP_Tx;
 
-       http_CopyReq(w, vc->fd, vc->http, sp->http);
-       http_FilterHeader(w, vc->fd, vc->http, sp->http, HTTPH_R_PIPE);
-       http_PrintfHeader(w, vc->fd, vc->http, "X-Varnish: %u", sp->xid);
-       http_PrintfHeader(w, vc->fd, vc->http,
+       http_CopyReq(w, vc->fd, vc->bereq, sp->http);
+       http_FilterHeader(w, vc->fd, vc->bereq, sp->http, HTTPH_R_PIPE);
+       http_PrintfHeader(w, vc->fd, vc->bereq, "X-Varnish: %u", sp->xid);
+       http_PrintfHeader(w, vc->fd, vc->bereq,
            "X-Forwarded-for: %s", sp->addr);
-       if (!http_GetHdr(vc->http, H_Host, &b)) {
-               http_PrintfHeader(w, vc->fd, vc->http, "Host: %s",
+       if (!http_GetHdr(vc->bereq, H_Host, &b)) {
+               http_PrintfHeader(w, vc->fd, vc->bereq, "Host: %s",
                    sp->backend->hostname);
        }
        WRK_Reset(w, &vc->fd);
-       http_Write(w, vc->http, 0);
+       http_Write(w, vc->bereq, 0);
 
        if (http_GetTail(sp->http, 0, &b, &e) && b != e)
                WRK_Write(w, b, e - b);