From 2357f74aef42d0926bb2ad195137cddc54e0de2c Mon Sep 17 00:00:00 2001 From: wessels <> Date: Wed, 4 Jun 1997 02:08:22 +0000 Subject: [PATCH] There were a couple of situations where we create new request_t structures 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 | 5 +++-- src/http.cc | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/client_side.cc b/src/client_side.cc index 235dfee94d..879e73f1fd 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -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, diff --git a/src/http.cc b/src/http.cc index 726a8a41a7..d76ece3eb1 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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, -- 2.47.2