From 220a39fb1140d781f885d3563190afa2843e6b9f Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Fri, 23 Jun 2000 18:02:16 +0000 Subject: [PATCH] Bring back the hokey call to ap_create_tcp_socket() so mpmt_pthread works again. It is completely hosed at the moment. Todo: remove the need for this call. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85675 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/mpmt_pthread/mpmt_pthread.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 5fe9a37f1e..1268eefbc9 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -736,7 +736,19 @@ static void child_main(int child_num_arg) /* Set up the pollfd array */ listensocks = ap_pcalloc(pchild, sizeof(*listensocks) * (num_listensocks + 1)); - ap_put_os_sock(&listensocks[0], &pipe_of_death[0], pchild); + + /* It is a horrible crime to use ap_create_tcp_socket() here, but it + * keeps ap_put_os_sock() from doing getsockname() on the pipe of death + * (which won't work). + * TODO - remove the need for such a hack! Jeff owns this problem. + */ + ap_create_tcp_socket(&listensocks[0], pchild); + rv = ap_put_os_sock(&listensocks[0], &pipe_of_death[0], pchild); + if (rv != APR_SUCCESS) { + ap_log_error(APLOG_MARK, APLOG_ALERT, rv, ap_server_conf, + "ap_put_os_sock() failed for the pipe of death"); + clean_child_exit(APEXIT_CHILDFATAL); + } for (lr = ap_listeners, i = 1; i <= num_listensocks; lr = lr->next, ++i) listensocks[i]=lr->sd; -- 2.40.0