]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
There were a couple of situations where we create new request_t structures
authorwessels <>
Wed, 4 Jun 1997 02:08:22 +0000 (02:08 +0000)
committerwessels <>
Wed, 4 Jun 1997 02:08:22 +0000 (02:08 +0000)
that didn't have the headers buf from the original request.  Fix was to
give httpBuildRequestHeader() one fewer argument because the headers
will be attached to the 'orig_request' arg anyway.

src/client_side.cc
src/http.cc

index 235dfee94d235b1b52c37c2f065cedf5b938ff59..879e73f1fd6262d7373d2d8439ad2dab1394dd80 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side.cc,v 1.109 1997/06/02 01:06:09 wessels Exp $
+ * $Id: client_side.cc,v 1.110 1997/06/03 20:08:22 wessels Exp $
  *
  * DEBUG: section 33    Client-side Routines
  * AUTHOR: Duane Wessels
@@ -178,6 +178,8 @@ clientRedirectDone(void *data, char *result)
        safe_free(http->url);
        http->url = xstrdup(result);
        new_request->http_ver = old_request->http_ver;
+       new_request->headers = old_request->headers;
+       new_request->headers_sz = old_request->headers_sz;
        requestUnlink(old_request);
        http->request = requestLink(new_request);
        urlCanonical(http->request, http->url);
@@ -515,7 +517,6 @@ clientConstructTraceEcho(clientHttpRequest * http)
     httpBuildRequestHeader(http->request,
        http->request,
        NULL,                   /* entry */
-       http->request->headers,
        NULL,                   /* in_len */
        buf + len,
        8192 - len,
index 726a8a41a7ffd0c09ec8d67d33cf95f0ac22329e..d76ece3eb1b52c58eb6f7a896848376277651613 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.168 1997/06/02 19:56:03 wessels Exp $
+ * $Id: http.cc,v 1.169 1997/06/03 20:08:23 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -657,7 +657,6 @@ size_t
 httpBuildRequestHeader(request_t * request,
     request_t * orig_request,
     StoreEntry * entry,
-    char *hdr_in,
     size_t * in_len,
     char *hdr_out,
     size_t out_sz,
@@ -677,7 +676,9 @@ httpBuildRequestHeader(request_t * request,
     int cc_flags = 0;
     int n;
     const char *url = NULL;
+    char *hdr_in = orig_request->headers;
 
+    assert(hdr_in != NULL);
     debug(11, 3, "httpBuildRequestHeader: INPUT:\n%s\n", hdr_in);
     xstrncpy(fwdbuf, "X-Forwarded-For: ", 4096);
     xstrncpy(viabuf, "Via: ", 4096);
@@ -804,7 +805,6 @@ httpSendRequest(int fd, void *data)
     len = httpBuildRequestHeader(req,
        httpState->orig_request ? httpState->orig_request : req,
        entry,
-       req->headers,
        NULL,
        buf,
        buflen,