You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modproxy-dev@apache.org by ba...@veribox.net on 2001/08/10 21:57:35 UTC

[PATCH] proxy_http.c

so here's the situation.
o client sends request to proxy.
o proxy sends request to webserver.
o webserver responds with 100.
o proxy passes 100 back to proxy.
o webserver follows up by sending something else such as 302.
o proxy drops the follow-up response and closes connection.
o client errors.

i'm seeing this with www.renttech.com and www.webmbo.com.
you can reproduce this on renttech.com by going to www.renttech.com,
and posting with the form on their start page.

barbee.

Index: proxy_http.c
===================================================================
RCS file: /home/cvspublic/httpd-proxy/module-2.0/proxy_http.c,v
retrieving revision 1.85
diff -u -a -r1.85 proxy_http.c
--- proxy_http.c        2001/08/07 21:46:47     1.85
+++ proxy_http.c        2001/08/10 18:14:33
@@ -207,6 +207,11 @@
     conn_rec *origin = NULL;
     apr_uri_components uri;
     proxy_conn_rec *backend;
+    int received_continue = 1; /* flag to indicate if we should

+                                * loop over response parsing logic
+                                * in the case that the origin told
us
+                                * to HTTP_CONTINUE
+                                */

     /* Note: Memory pool allocation.
      * A downstream keepalive connection is always connected to the
existence
@@ -619,6 +624,7 @@

     apr_brigade_cleanup(bb);

+    while (received_continue) {
     if (APR_SUCCESS != (rv = ap_proxy_string_read(origin, bb, buffer,
sizeof(buffer), &eos))) {
        apr_socket_close(sock);
        backend->connection = NULL;
@@ -708,6 +714,12 @@
        close += 1;
     }

+        if ( r->status != HTTP_CONTINUE ) {
+            received_continue = 0;
+        } else {
+            ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0,
NULL,
+                         "proxy: HTTP: received 100 CONTINUE");

+        }
     /* we must accept 3 kinds of date, but generate only 1 kind of
date */
     {
        const char *buf;
@@ -803,7 +815,7 @@
        ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
"proxy: header only");
     }
-
+    }

     /*
      * Step Five: Clean Up