From: Jim Jagielski Date: Thu, 5 Sep 2002 19:53:35 +0000 (+0000) Subject: Hmm... We need to also address the fact that the response may have X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64625f60ae293c63b0ec73258333482fc76848fd;p=thirdparty%2Fapache%2Fhttpd.git Hmm... We need to also address the fact that the response may have no Content-Length at all, but the cached info does (think 304). We also need to update the cache file if we update/use the old c-l value (the previously stored values are bogus). PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@96649 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/modules/proxy/proxy_cache.c b/src/modules/proxy/proxy_cache.c index 111ac5c2e07..e984fb2637b 100644 --- a/src/modules/proxy/proxy_cache.c +++ b/src/modules/proxy/proxy_cache.c @@ -1563,13 +1563,16 @@ int ap_proxy_cache_update(cache_req *c, table *resp_hdrs, /* recall at this point that c->len is already set from resp_hdrs. If Content-Length was NULL, then c->len is -1, otherwise it's set to whatever the value was. */ - if (c->len == 0) { + if (c->len == 0 || c->len == -1) { const char *c_clen_str; off_t c_clen; if ( (c_clen_str = ap_table_get(c->hdrs, "Content-Length")) && ( (c_clen = ap_strtol(c_clen_str, NULL, 10)) > 0) ) { ap_table_set(resp_hdrs, "Content-Length", c_clen_str); c->len = c_clen; + ap_proxy_sec2hex(c->len, buff + 17 * (6)); + buff[17 * (7) - 1] = '\n'; + buff[17 * (7)] = '\0'; } } if (!ap_proxy_table_replace(c->hdrs, resp_hdrs)) {