]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Hmm... We need to also address the fact that the response may have
authorJim Jagielski <jim@apache.org>
Thu, 5 Sep 2002 19:53:35 +0000 (19:53 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 5 Sep 2002 19:53:35 +0000 (19:53 +0000)
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

src/modules/proxy/proxy_cache.c

index 111ac5c2e07b042d18062640a626e96cf1e28a2f..e984fb2637b7bd8e02b067b8cbe486a48ed8f676 100644 (file)
@@ -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)) {