httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r124562 - /httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c
Date Fri, 07 Jan 2005 19:37:34 GMT
Author: trawick
Date: Fri Jan  7 11:37:33 2005
New Revision: 124562

URL: http://svn.apache.org/viewcvs?view=rev&rev=124562
Log:
watch out for "Content-Length: 0" more carefully; it has
to be handled a certain way

Modified:
   httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c

Modified: httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c
Url: http://svn.apache.org/viewcvs/httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c?view=diff&rev=124562&p1=httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c&r1=124561&p2=httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c&r2=124562
==============================================================================
--- httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c	(original)
+++ httpd/httpd/branches/proxy-reqbody/modules/proxy/proxy_http.c	Fri Jan  7 11:37:33 2005
@@ -626,6 +626,7 @@
 {
     enum {RB_INIT, RB_STREAM_CL, RB_STREAM_CHUNKED, RB_SPOOL_CL} rb_method = RB_INIT;
     const char *old_cl_val, *te_val;
+    int cl_zero; /* client sent "Content-Length: 0", which we forward on to server */
     apr_status_t status;
 
     /* send CL or use chunked encoding?
@@ -656,17 +657,22 @@
      * . proxy-sendunchangedcl
      *   use C-L from client and spool the request body
      */
-    if (!force10 && apr_table_get(r->subprocess_env, "proxy-sendchunks")) {
+    old_cl_val = apr_table_get(r->headers_in, "Content-Length");
+    cl_zero = old_cl_val && !strcmp(old_cl_val, "0");
+
+    if (!force10
+        && !cl_zero
+        && apr_table_get(r->subprocess_env, "proxy-sendchunks")) {
         rb_method = RB_STREAM_CHUNKED;
     }
-    else if (apr_table_get(r->subprocess_env, "proxy-sendcl")) {
+    else if (!cl_zero
+             && apr_table_get(r->subprocess_env, "proxy-sendcl")) {
         rb_method = RB_SPOOL_CL;
     }
     else {
-        old_cl_val = apr_table_get(r->headers_in, "Content-Length");
         if (old_cl_val &&
             (r->input_filters == r->proto_input_filters
-             || !strcmp(old_cl_val, "0")
+             || cl_zero
              || apr_table_get(r->subprocess_env, "proxy-sendunchangedcl"))) {
             rb_method = RB_STREAM_CL;
         }
@@ -887,8 +893,7 @@
             || !apr_strnatcasecmp(headers_in[counter].key, "Transfer-Encoding")
             || !apr_strnatcasecmp(headers_in[counter].key, "Upgrade")
 
-            /* We have no way of knowing whether this Content-Length will
-             * be accurate, so we must not include it.
+            /* We'll add appropriate Content-Length later, if appropriate.
              */
             || !apr_strnatcasecmp(headers_in[counter].key, "Content-Length")
         /* XXX: @@@ FIXME: "Proxy-Authorization" should *only* be 

Mime
View raw message