]> err.no Git - varnish/commitdiff
Don't pollute bereq.* in vcl_fetch{} with the reply
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 27 Feb 2009 11:36:16 +0000 (11:36 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Fri, 27 Feb 2009 11:36:16 +0000 (11:36 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3833 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_vrt.c

index 0993301db26e7a4ee404bcdaa6a1e1913d958ca5..63c230fd4c210ea518ea4bd3e30ff1b7c24cf514 100644 (file)
@@ -242,7 +242,7 @@ struct bereq {
 #define BEREQ_MAGIC            0x3b6d250c
        VTAILQ_ENTRY(bereq)     list;
        struct ws               ws[1];
-       struct http             http[1];
+       struct http             http[2];
 };
 
 /* Storage -----------------------------------------------------------*/
index e691b5340cbbe34a1f9e36effaf0f76b83d6df55..3637feddd91ff14f63afbf26196a21b8919e2fe1 100644 (file)
@@ -163,7 +163,8 @@ VBE_new_bereq(void)
                WS_Init(bereq->ws, "bereq", bereq + 1, len);
                VSL_stats->n_bereq++;
        }
-       http_Setup(bereq->http, bereq->ws);
+       http_Setup(&bereq->http[0], bereq->ws);
+       http_Setup(&bereq->http[1], bereq->ws);
        return (bereq);
 }
 
index fd08aecbf127ffd357e9fb651f912f74ff821ccb..03e928c5c2e532c37cd707209e90d363eeed99ab 100644 (file)
@@ -329,9 +329,12 @@ Fetch(struct sess *sp)
        if (sp->obj->objcore != NULL)           /* pass has no objcore */
                AN(ObjIsBusy(sp->obj));
        AN(sp->bereq);
+
+       /* Transmit request */
+
        w = sp->wrk;
        bereq = sp->bereq;
-       hp = bereq->http;
+       hp = &bereq->http[0];
        is_head = (strcasecmp(http_GetReq(hp), "head") == 0);
 
        sp->obj->xid = sp->xid;
@@ -371,6 +374,8 @@ Fetch(struct sess *sp)
        /* XXX is this the right place? */
        VSL_stats->backend_req++;
 
+       /* Receive response */
+
        HTC_Init(htc, bereq->ws, vc->fd);
        TCP_set_read_timeout(vc->fd, sp->first_byte_timeout);
        do {
@@ -385,6 +390,8 @@ Fetch(struct sess *sp)
                return (__LINE__);
        }
 
+       hp = &bereq->http[1];
+
        if (http_DissectResponse(sp->wrk, htc, hp)) {
                VBE_ClosedFd(sp);
                /* XXX: other cleanup ? */
index aacfe39da125e8c5061ed3492728bd07713ac66c..bfddf0c7f0b465904c04ef8dfd8e713d37074442 100644 (file)
@@ -100,7 +100,7 @@ vrt_selecthttp(const struct sess *sp, enum gethdr_e where)
                hp = sp->http;
                break;
        case HDR_BEREQ:
-               hp = sp->bereq->http;
+               hp = &sp->bereq->http[0];
                break;
        case HDR_RESP:
                hp = sp->http;