Commit 893e5886 authored by Jeff Trawick's avatar Jeff Trawick
Browse files

Handle ap_discard_request_body() being called more than once.

Add a debug assertion to verify that c->remain is zero when a new
request starts.  ap_http_filter() does the wrong thing otherwise.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88540 13f79535-47bb-0310-9956-ffa450edef68
parent fae338cd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.15-dev

  *) Handle ap_discard_request_body() being called more than once.
     [Greg Ames, Jeff Trawick]

  *) Get rid of an inadvertent close of file descriptor 2 in
     mod_mime_magic.  [Greg Ames, Jeff Trawick]

+4 −2
Original line number Diff line number Diff line
@@ -1450,8 +1450,10 @@ AP_DECLARE(int) ap_discard_request_body(request_rec *r)
{
    int rv;

    if (r->read_length == 0) { /* if not read already */
        if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)))
            return rv;
    }

    /* In order to avoid sending 100 Continue when we already know the
     * final response status, and yet not kill the connection if there is
+2 −0
Original line number Diff line number Diff line
@@ -844,6 +844,8 @@ request_rec *ap_read_request(conn_rec *conn)
    const char *expect;
    int access_status;

    AP_DEBUG_ASSERT(conn->remain == 0);

    apr_pool_create(&p, conn->pool);
    r = apr_pcalloc(p, sizeof(request_rec));
    r->pool            = p;