summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2000-12-04 20:24:10 +0100
committerJeff Trawick <trawick@apache.org>2000-12-04 20:24:10 +0100
commit4c8baf6170c013aa9eff3aea49e99a45c539c0d7 (patch)
treed664e1e92bbab11925a439256c3a58a1a0243b7e /server
parentGet WIN32 building again (diff)
downloadapache2-4c8baf6170c013aa9eff3aea49e99a45c539c0d7.tar.xz
apache2-4c8baf6170c013aa9eff3aea49e99a45c539c0d7.zip
Get rid of ap_new_apr_connection(). ap_new_connection() now has
fewer parameters: the local and remote socket addresses were removed from the parameter list because all required information is available via the APR socket. I haven't tested the most important part -- the WinNT MPM changes -- but it compiles and it looks okay :) If the WinNT MPM works on Win98 these days let me know. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87181 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--server/connection.c21
-rw-r--r--server/mpm/beos/beos.c3
-rw-r--r--server/mpm/dexter/dexter.c3
-rw-r--r--server/mpm/experimental/perchild/perchild.c3
-rw-r--r--server/mpm/mpmt_beos/mpmt_beos.c3
-rw-r--r--server/mpm/mpmt_pthread/mpmt_pthread.c3
-rw-r--r--server/mpm/perchild/perchild.c3
-rw-r--r--server/mpm/prefork/prefork.c4
-rw-r--r--server/mpm/spmt_os2/spmt_os2.c4
-rw-r--r--server/mpm/winnt/mpm_winnt.c9
10 files changed, 21 insertions, 35 deletions
diff --git a/server/connection.c b/server/connection.c
index 12c3576ea2..e86a037ad5 100644
--- a/server/connection.c
+++ b/server/connection.c
@@ -269,9 +269,7 @@ int ap_process_http_connection(conn_rec *c)
*/
conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server,
- apr_socket_t *inout,
- const struct sockaddr_in *remaddr,
- const struct sockaddr_in *saddr, long id)
+ apr_socket_t *inout, long id)
{
conn_rec *conn = (conn_rec *) apr_pcalloc(p, sizeof(conn_rec));
apr_sockaddr_t *sa;
@@ -284,29 +282,16 @@ conn_rec *ap_new_connection(apr_pool_t *p, server_rec *server,
conn->notes = apr_make_table(p, 5);
conn->pool = p;
- conn->local_addr = *saddr;
apr_get_sockaddr(&sa, APR_LOCAL, inout);
+ conn->local_addr = sa->sa.sin;
apr_get_ipaddr(&conn->local_ip, sa);
conn->base_server = server;
conn->client_socket = inout;
- conn->remote_addr = *remaddr;
apr_get_sockaddr(&sa, APR_REMOTE, inout);
+ conn->remote_addr = sa->sa.sin;
apr_get_ipaddr(&conn->remote_ip, sa);
conn->id = id;
return conn;
}
-
-
-
-conn_rec *ap_new_apr_connection(apr_pool_t *p, server_rec *server,
- apr_socket_t *conn_socket, long id)
-{
- apr_sockaddr_t *sa_local, *sa_remote;
-
- apr_get_sockaddr(&sa_local, APR_LOCAL, conn_socket);
- apr_get_sockaddr(&sa_remote, APR_REMOTE, conn_socket);
- return ap_new_connection(p, server, conn_socket,
- &sa_remote->sa.sin, &sa_local->sa.sin, id);
-}
diff --git a/server/mpm/beos/beos.c b/server/mpm/beos/beos.c
index 9d365a7d10..495eb5b3e2 100644
--- a/server/mpm/beos/beos.c
+++ b/server/mpm/beos/beos.c
@@ -320,8 +320,7 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, int my_child_num)
return;
}
- current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
- conn_id);
+ current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c
index cf11a0ab70..9f63a44d19 100644
--- a/server/mpm/dexter/dexter.c
+++ b/server/mpm/dexter/dexter.c
@@ -414,8 +414,7 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, long conn_id)
ap_sock_disable_nagle(sock);
- current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
- conn_id);
+ current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/experimental/perchild/perchild.c b/server/mpm/experimental/perchild/perchild.c
index d934e9e99a..c5230aa80c 100644
--- a/server/mpm/experimental/perchild/perchild.c
+++ b/server/mpm/experimental/perchild/perchild.c
@@ -453,8 +453,7 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, long conn_id)
ap_sock_disable_nagle(sock);
}
- current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
- conn_id);
+ current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/mpmt_beos/mpmt_beos.c b/server/mpm/mpmt_beos/mpmt_beos.c
index 26df7bc9ef..3f62b40e7d 100644
--- a/server/mpm/mpmt_beos/mpmt_beos.c
+++ b/server/mpm/mpmt_beos/mpmt_beos.c
@@ -299,8 +299,7 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, int my_child_num,
long conn_id = my_child_num * HARD_THREAD_LIMIT + my_thread_num;
int csd;
- current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
- conn_id);
+ current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c
index 1a37e9bd1d..e43440c993 100644
--- a/server/mpm/mpmt_pthread/mpmt_pthread.c
+++ b/server/mpm/mpmt_pthread/mpmt_pthread.c
@@ -412,8 +412,7 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, int my_child_num,
(void) ap_update_child_status(my_child_num, my_thread_num,
SERVER_BUSY_READ, (request_rec *) NULL);
- current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
- conn_id);
+ current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/perchild/perchild.c b/server/mpm/perchild/perchild.c
index d934e9e99a..c5230aa80c 100644
--- a/server/mpm/perchild/perchild.c
+++ b/server/mpm/perchild/perchild.c
@@ -453,8 +453,7 @@ static void process_socket(apr_pool_t *p, apr_socket_t *sock, long conn_id)
ap_sock_disable_nagle(sock);
}
- current_conn = ap_new_apr_connection(p, ap_server_conf, sock,
- conn_id);
+ current_conn = ap_new_connection(p, ap_server_conf, sock, conn_id);
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/prefork/prefork.c b/server/mpm/prefork/prefork.c
index 2e92927ab7..77b217b3d9 100644
--- a/server/mpm/prefork/prefork.c
+++ b/server/mpm/prefork/prefork.c
@@ -1042,8 +1042,8 @@ static void child_main(int child_num_arg)
(void) ap_update_child_status(my_child_num, SERVER_BUSY_READ,
(request_rec *) NULL);
- current_conn = ap_new_apr_connection(ptrans, ap_server_conf, csd,
- my_child_num);
+ current_conn = ap_new_connection(ptrans, ap_server_conf, csd,
+ my_child_num);
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/spmt_os2/spmt_os2.c b/server/mpm/spmt_os2/spmt_os2.c
index 83b87e74de..37b3dee385 100644
--- a/server/mpm/spmt_os2/spmt_os2.c
+++ b/server/mpm/spmt_os2/spmt_os2.c
@@ -964,8 +964,8 @@ static void child_main(void *child_num_arg)
(void) ap_update_child_status(THREAD_GLOBAL(child_num), SERVER_BUSY_READ,
(request_rec *) NULL);
- current_conn = ap_new_apr_connection(ptrans, ap_server_conf, csd,
- THREAD_GLOBAL(child_num));
+ current_conn = ap_new_connection(ptrans, ap_server_conf, csd,
+ THREAD_GLOBAL(child_num));
ap_process_connection(current_conn);
ap_lingering_close(current_conn);
diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c
index 5a4b36e594..41f2c41833 100644
--- a/server/mpm/winnt/mpm_winnt.c
+++ b/server/mpm/winnt/mpm_winnt.c
@@ -1121,6 +1121,7 @@ static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT context)
static void worker_main(int child_num)
{
PCOMP_CONTEXT context = NULL;
+ apr_os_sock_info_t sockinfo;
while (1) {
conn_rec *c;
@@ -1137,7 +1138,13 @@ static void worker_main(int child_num)
if (!context)
break;
sock_disable_nagle(context->accept_socket);
- apr_put_os_sock(&context->sock, &context->accept_socket, context->ptrans);
+
+ sockinfo.os_sock = &context->accept_socket;
+ sockinfo.local = context->sa_server;
+ sockinfo.remote = context->sa_client;
+ sockinfo.family = APR_INET;
+ sockinfo.type = SOCK_STREAM;
+ apr_make_os_sock(&context->sock, &sockinfo, context->ptrans);
c = ap_new_connection(context->ptrans, server_conf, context->sock,
(struct sockaddr_in *) context->sa_client,