From df37d04f0436f2234162d8885027522fe1ca62e7 Mon Sep 17 00:00:00 2001 From: Brian Havard Date: Sun, 24 Oct 1999 13:08:30 +0000 Subject: [PATCH] Add a context parameter to ap_accept() for the connection socket to be allocated from. This is needed because the lifetime of a connection is ususally much shorter than that of the listen socket. Only tested on OS/2. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84031 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/dexter/dexter.c | 2 +- server/mpm/mpmt_beos/mpmt_beos.c | 7 ++----- server/mpm/mpmt_pthread/mpmt_pthread.c | 7 ++----- server/mpm/prefork/prefork.c | 2 +- server/mpm/spmt_os2/spmt_os2.c | 2 +- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index 017c0b98d2..cc0ef3f27b 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -934,7 +934,7 @@ static void *worker_thread(void *arg) } got_fd: if (!workers_may_exit) { - ap_accept(&csd, sd); + ap_accept(&csd, sd, ptrans); SAFE_ACCEPT(accept_mutex_off(0)); SAFE_ACCEPT(intra_mutex_off(0)); pthread_mutex_lock(&idle_thread_count_mutex); diff --git a/server/mpm/mpmt_beos/mpmt_beos.c b/server/mpm/mpmt_beos/mpmt_beos.c index aa297e432f..ce0912aecb 100644 --- a/server/mpm/mpmt_beos/mpmt_beos.c +++ b/server/mpm/mpmt_beos/mpmt_beos.c @@ -673,10 +673,7 @@ static void process_socket(ap_context_t *p, struct sockaddr *sa_client, int csd, conn_io = ap_bcreate(p, B_RDWR); ap_bpush_iol(conn_io, iol); - current_conn = ap_new_connection(p, server_conf, conn_io, - (const struct sockaddr_in *) sa_client, - (const struct sockaddr_in *) &sa_server, - conn_id); + current_conn = ap_new_connection(p, server_conf, conn_io, csd, conn_id); ap_process_connection(current_conn); } @@ -761,7 +758,7 @@ static int32 worker_thread(void * dummy) } got_fd: if (!workers_may_exit) { - ap_accept(&csd, sd); + ap_accept(&csd, sd, ptrans); SAFE_ACCEPT(accept_mutex_off(0)); SAFE_ACCEPT(intra_mutex_off(0)); } diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index a390c51f05..fa291d9ee2 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -763,10 +763,7 @@ static void process_socket(ap_context_t *p, struct sockaddr *sa_client, int csd, conn_io = ap_bcreate(p, B_RDWR); ap_bpush_iol(conn_io, iol); - current_conn = ap_new_connection(p, server_conf, conn_io, - (const struct sockaddr_in *) sa_client, - (const struct sockaddr_in *) &sa_server, - conn_id); + current_conn = ap_new_apr_connection(p, server_conf, conn_io, csd, conn_id); ap_process_connection(current_conn); } @@ -885,7 +882,7 @@ static void * worker_thread(void * dummy) } got_fd: if (!workers_may_exit) { - ap_accept(&csd, sd); + ap_accept(&csd, sd, ptrans); SAFE_ACCEPT(accept_mutex_off(0)); SAFE_ACCEPT(intra_mutex_off(0)); } diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c index 2660806e7f..c76c171145 100644 --- a/server/mpm/prefork/prefork.c +++ b/server/mpm/prefork/prefork.c @@ -2077,7 +2077,7 @@ static void child_main(int child_num_arg) clean_child_exit(0); } clen = sizeof(sa_client); - stat = ap_accept(&csd, sd); + stat = ap_accept(&csd, sd, ptrans); if (stat == APR_SUCCESS || stat != APR_EINTR) break; } diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c index 98c1f842d8..f9245320c3 100644 --- a/server/mpm/spmt_os2/spmt_os2.c +++ b/server/mpm/spmt_os2/spmt_os2.c @@ -1046,7 +1046,7 @@ static void child_main(void *child_num_arg) /* we didn't get a socket, and we were told to die */ clean_child_exit(0); } - rv = ap_accept(&csd, sd); + rv = ap_accept(&csd, sd, ptrans); if (rv != APR_EINTR) break; } -- 2.40.0