Commit 25ca91df authored by Jeff Trawick's avatar Jeff Trawick
Browse files

ap_new_connection() returns NULL if an error occurred (prefork MPM

and ap_new_connection() were changed last week)

I have skipped putting the change into WinNT MPM and mod_proxy.  I
left a note in the mod_proxy code; for the NT MPM I think I can talk
somebody into doing the right thing for me.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87982 13f79535-47bb-0310-9956-ffa450edef68
parent 69c5639f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
Changes with Apache 2.0b1

  *) ap_new_connection() closes the socket and returns NULL if a socket
     call fails.  Usually this is due to a connection which has been 
     reset.  [Jeff Trawick]

  *) Move the Apache version information out of httpd.h and into release.h.
     This is in preparation for the first tag with the new tag and release
     system.  [Ryan Bloom]
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ extern "C" {
 * @param server The server to create the connection for
 * @param inout The socket to use for all communication with the client
 * @param id ID of this connection; unique at any point in time.
 * @return new conn_rec, or NULL if the connection has already been reset
 */
conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server, 
                            apr_socket_t *inout, long id);
+6 −0
Original line number Diff line number Diff line
@@ -277,6 +277,12 @@ int ap_proxy_http_handler(request_rec *r, char *url,
    }

    origin = ap_new_connection(r->pool, r->server, sock, 0);
    if (!origin) {
        /* the peer reset the connection already; ap_new_connection() 
         * closed the socket */
        /* XXX somebody that knows what they're doing add an error path */
    }

    ap_add_output_filter("CORE", NULL, NULL, origin);

    clear_connection(r->pool, r->headers_in);	/* Strip connection-based headers */
+4 −3
Original line number Diff line number Diff line
@@ -317,10 +317,11 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, int my_child_num)
    }
    
    current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);

    if (current_conn) {
        ap_process_connection(current_conn);
        ap_lingering_close(current_conn);
    }
}

static int32 worker_thread(void * dummy)
{
+4 −3
Original line number Diff line number Diff line
@@ -419,10 +419,11 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, long conn_id)
                                  SERVER_BUSY_READ, (request_rec *) NULL);

    current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);

    if (current_conn) {
        ap_process_connection(current_conn);
        ap_lingering_close(current_conn);
    }
}

static void *worker_thread(void *);

Loading