From: wessels <> Date: Mon, 2 Jun 1997 00:19:51 +0000 (+0000) Subject: start removing mem_obj->req_hdr and moving it to request_t->headers X-Git-Tag: SQUID_3_0_PRE1~4964 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=62dec5a79d815a1b08c7bda6cfad24c13a3cdf02;p=thirdparty%2Fsquid.git start removing mem_obj->req_hdr and moving it to request_t->headers --- diff --git a/src/client_side.cc b/src/client_side.cc index 04dd36eabc..6a2736a4ad 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.107 1997/05/23 17:21:17 wessels Exp $ + * $Id: client_side.cc,v 1.108 1997/06/01 18:19:51 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -328,7 +328,6 @@ icpProcessExpired(int fd, void *data) { clientHttpRequest *http = data; char *url = http->url; - char *request_hdr = http->request_hdr; StoreEntry *entry = NULL; debug(33, 3, "icpProcessExpired: FD %d '%s'\n", fd, http->url); @@ -336,8 +335,6 @@ icpProcessExpired(int fd, void *data) BIT_SET(http->request->flags, REQ_REFRESH); http->old_entry = http->entry; entry = storeCreateEntry(url, - request_hdr, - http->req_hdr_sz, http->request->flags, http->request->method); /* NOTE, don't call storeLockObject(), storeCreateEntry() does it */ diff --git a/src/ftp.cc b/src/ftp.cc index 8f37e0cb49..12fc62ee90 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.113 1997/06/01 04:23:11 wessels Exp $ + * $Id: ftp.cc,v 1.114 1997/06/01 18:19:52 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -823,19 +823,17 @@ ftpStart(request_t * request, StoreEntry * entry) LOCAL_ARRAY(char, realm, 8192); char *url = entry->url; FtpStateData *ftpState = xcalloc(1, sizeof(FtpStateData)); - char *req_hdr; char *response; int fd; debug(9, 3, "FtpStart: '%s'\n", entry->url); storeLockObject(entry); ftpState->entry = entry; - req_hdr = entry->mem_obj->request_hdr; ftpState->request = requestLink(request); ftpState->ctrl.fd = -1; ftpState->data.fd = -1; EBIT_SET(ftpState->flags, FTP_PASV_SUPPORTED); EBIT_SET(ftpState->flags, FTP_REST_SUPPORTED); - if (!ftpCheckAuth(ftpState, req_hdr)) { + if (!ftpCheckAuth(ftpState, request->headers)) { /* This request is not fully authenticated */ if (request->port == 21) { sprintf(realm, "ftp %s", ftpState->user); diff --git a/src/http.cc b/src/http.cc index 03e98f7b08..16e3e9d162 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.164 1997/05/23 05:20:57 wessels Exp $ + * $Id: http.cc,v 1.165 1997/06/01 18:19:52 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -790,8 +790,8 @@ httpSendRequest(int fd, void *data) debug(11, 5, "httpSendRequest: FD %d: httpState %p.\n", fd, httpState); buflen = strlen(req->urlpath); - if (httpState->req_hdr) - buflen += httpState->req_hdr_sz + 1; + if (req->headers) + buflen += req->headers_sz + 1; buflen += 512; /* lots of extra */ if ((req->method == METHOD_POST || req->method == METHOD_PUT)) { @@ -815,7 +815,7 @@ httpSendRequest(int fd, void *data) len = httpBuildRequestHeader(req, httpState->orig_request ? httpState->orig_request : req, entry, - httpState->req_hdr, + req->headers, NULL, buf, buflen, @@ -841,8 +841,6 @@ proxyhttpStart(request_t * orig_request, int fd; debug(11, 3, "proxyhttpStart: \"%s %s\"\n", RequestMethodStr[orig_request->method], entry->url); - debug(11, 10, "proxyhttpStart: HTTP request header:\n%s\n", - entry->mem_obj->request_hdr); if (e->options & NEIGHBOR_PROXY_ONLY) #if DONT_USE_VM storeReleaseRequest(entry); @@ -864,8 +862,6 @@ proxyhttpStart(request_t * orig_request, storeLockObject(entry); httpState = xcalloc(1, sizeof(HttpStateData)); httpState->entry = entry; - httpState->req_hdr = entry->mem_obj->request_hdr; - httpState->req_hdr_sz = entry->mem_obj->request_hdr_sz; request = get_free_request_t(); httpState->request = requestLink(request); httpState->neighbor = e; @@ -953,8 +949,6 @@ httpStart(request_t * request, StoreEntry * entry) storeLockObject(entry); httpState = xcalloc(1, sizeof(HttpStateData)); httpState->entry = entry; - httpState->req_hdr = entry->mem_obj->request_hdr; - httpState->req_hdr_sz = entry->mem_obj->request_hdr_sz; httpState->request = requestLink(request); httpState->fd = fd; comm_add_close_handler(httpState->fd, diff --git a/src/store.cc b/src/store.cc index d06b0b9c13..386be60e77 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.245 1997/05/23 20:45:58 wessels Exp $ + * $Id: store.cc,v 1.246 1997/06/01 18:19:56 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -365,7 +365,6 @@ destroy_MemObject(MemObject * mem) debug(20, 3, "destroy_MemObject: destroying %p\n", mem); destroy_MemObjectData(mem); safe_free(mem->clients); - safe_free(mem->request_hdr); safe_free(mem->reply); safe_free(mem->e_abort_msg); requestUnlink(mem->request); @@ -737,11 +736,7 @@ storeSetPublicKey(StoreEntry * e) } StoreEntry * -storeCreateEntry(const char *url, - const char *req_hdr, - int req_hdr_sz, - int flags, - method_t method) +storeCreateEntry(const char *url, int flags, method_t method) { StoreEntry *e = NULL; MemObject *mem = NULL; @@ -753,12 +748,6 @@ storeCreateEntry(const char *url, e->url = xstrdup(url); meta_data.url_strings += strlen(url); e->method = method; - if (req_hdr) { - mem->request_hdr_sz = req_hdr_sz; - mem->request_hdr = xmalloc(req_hdr_sz + 1); - xmemcpy(mem->request_hdr, req_hdr, req_hdr_sz); - *(mem->request_hdr + req_hdr_sz) = '\0'; - } if (BIT_TEST(flags, REQ_CACHABLE)) { BIT_SET(e->flag, ENTRY_CACHABLE); BIT_RESET(e->flag, RELEASE_REQUEST); @@ -1662,7 +1651,6 @@ storeComplete(StoreEntry * e) storeSetMemStatus(e, IN_MEMORY); e->swap_status = NO_SWAP; InvokeHandlers(e); - safe_free(e->mem_obj->request_hdr); if (BIT_TEST(e->flag, RELEASE_REQUEST)) storeRelease(e); else if (storeCheckSwapable(e))