Commit a2e4cdef authored by Ryan Bloom's avatar Ryan Bloom
Browse files

Fix the proxy when the origin server sends back a 100

Continue response.  [John Barbee <barbee@veribox.net>]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90092 13f79535-47bb-0310-9956-ffa450edef68
parent 9b8932f9
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
mod_proxy changes for httpd 2.0.23-dev

  *) Fix the proxy when the origin server sends back a 100
     Continue response.  [John Barbee <barbee@veribox.net>]

  *) Change 'readbytes' from apr_size_t to apr_off_t due to change
     in ap_get_brigade's parameters [Barbee barbee@veribox.nbet]
     in ap_get_brigade's parameters [John Barbee <barbee@veribox.net>]

mod_proxy changes for httpd 2.0.20-dev
  *) Timeout added for backend connections.
+192 −180
Original line number Diff line number Diff line
@@ -207,6 +207,11 @@ int ap_proxy_http_handler(request_rec *r, proxy_server_conf *conf,
    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 @@ int ap_proxy_http_handler(request_rec *r, proxy_server_conf *conf,

    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 @@ int ap_proxy_http_handler(request_rec *r, proxy_server_conf *conf,
                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 @@ int ap_proxy_http_handler(request_rec *r, proxy_server_conf *conf,
            ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, r->server,
            	     "proxy: header only");
        }

    }

    /*
     * Step Five: Clean Up