]> err.no Git - varnish/commitdiff
Fix a long-standing bug in pipe-mode: We must pass the protocol version
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 20 Aug 2007 11:05:07 +0000 (11:05 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 20 Aug 2007 11:05:07 +0000 (11:05 +0000)
across unchanged, otherwise the semantics of the Connection: header cannot
be interpreted correctly by the server.

wget(1) could trigger this problem and would have to wait for the server
to close the (seemingly idle) connection before continuing.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1888 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_http.c

index 6bb44934571a0f3c8e93bed839267e9c8c57fcc2..8834437e526d4c258cd5b445c40814614d9c67f8 100644 (file)
@@ -701,17 +701,20 @@ http_copyh(struct http *to, struct http *fm, unsigned n)
 }
 
 static void
-http_copyreq(struct http *to, struct http *fm, int forceget)
+http_copyreq(struct http *to, struct http *fm, int transparent)
 {
 
        CHECK_OBJ_NOTNULL(fm, HTTP_MAGIC);
        CHECK_OBJ_NOTNULL(to, HTTP_MAGIC);
-       if (forceget)
-               http_SetH(to, HTTP_HDR_REQ, "GET");
-       else
+       if (transparent)
                http_copyh(to, fm, HTTP_HDR_REQ);
+       else
+               http_SetH(to, HTTP_HDR_REQ, "GET");
        http_copyh(to, fm, HTTP_HDR_URL);
-       http_SetH(to, HTTP_HDR_PROTO, "HTTP/1.1");
+       if (transparent)
+               http_copyh(to, fm, HTTP_HDR_PROTO);
+       else
+               http_SetH(to, HTTP_HDR_PROTO, "HTTP/1.1");
 }
 
 void
@@ -792,7 +795,7 @@ http_FilterHeader(struct sess *sp, unsigned how)
         hp = bereq->http;
         hp->logtag = HTTP_Tx;
 
-       http_copyreq(hp, sp->http, how != HTTPH_R_PIPE);
+       http_copyreq(hp, sp->http, how == HTTPH_R_PIPE);
        http_FilterFields(sp->wrk, sp->fd, hp, sp->http, how);
        http_PrintfHeader(sp->wrk, sp->fd, hp, "X-Varnish: %u", sp->xid);
        http_PrintfHeader(sp->wrk, sp->fd, hp,