From: Jacob Champion Date: Mon, 29 Aug 2016 23:56:18 +0000 (+0000) Subject: mpm_winnt: remove the AcceptEx data network bucket X-Git-Tag: 2.5.0-alpha~1179 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c9ee4bd3d366ec1f5e566cd1fca4ceebb131274;p=apache mpm_winnt: remove the AcceptEx data network bucket Follow-up to the prior commit: without an incoming data buffer, the custom network bucket code is now orphaned and we can remove it entirely. This has the added benefit that we are no longer using the internal OVERLAPPED.Pointer field, which is discouraged by the MSDN docs. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1758308 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index 321a0240d8..5e771fd70a 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -574,8 +574,6 @@ reinit: /* target of connect upon too many AcceptEx failures */ lpfnGetAcceptExSockaddrs(buf, 0, PADDED_ADDR_SIZE, PADDED_ADDR_SIZE, &context->sa_server, &context->sa_server_len, &context->sa_client, &context->sa_client_len); - - context->overlapped.Pointer = NULL; } else /* (accf = 0) e.g. 'none' */ { @@ -649,7 +647,6 @@ reinit: /* target of connect upon too many AcceptEx failures */ * os_sock_make and os_sock_put that it does not query). */ WSAEventSelect(context->accept_socket, 0, 0); - context->overlapped.Pointer = NULL; err_count = 0; context->sa_server_len = sizeof(context->buff) / 2; @@ -754,24 +751,6 @@ static winnt_conn_ctx_t *winnt_get_connection(winnt_conn_ctx_t *context) return context; } -apr_status_t winnt_insert_network_bucket(conn_rec *c, - apr_bucket_brigade *bb, - apr_socket_t *socket) -{ - apr_bucket *e; - winnt_conn_ctx_t *context = ap_get_module_config(c->conn_config, - &mpm_winnt_module); - if (context == NULL || (e = context->overlapped.Pointer) == NULL) - return AP_DECLINED; - - /* seed the brigade with AcceptEx read heap bucket */ - APR_BRIGADE_INSERT_HEAD(bb, e); - /* also seed the brigade with the client socket. */ - e = apr_bucket_socket_create(socket, c->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(bb, e); - return APR_SUCCESS; -} - /* * worker_main() * Main entry point for the worker threads. Worker threads block in @@ -785,7 +764,6 @@ static DWORD __stdcall worker_main(void *thread_num_val) winnt_conn_ctx_t *context = NULL; int thread_num = (int)thread_num_val; ap_sb_handle_t *sbh; - apr_bucket *e; int rc; conn_rec *c; apr_int32_t disconnected; @@ -812,8 +790,6 @@ static DWORD __stdcall worker_main(void *thread_num_val) } } - e = context->overlapped.Pointer; - ap_create_sb_handle(&sbh, context->ptrans, 0, thread_num); c = ap_run_create_connection(context->ptrans, ap_server_conf, context->sock, thread_num, sbh, @@ -822,9 +798,6 @@ static DWORD __stdcall worker_main(void *thread_num_val) if (!c) { /* ap_run_create_connection closes the socket on failure */ context->accept_socket = INVALID_SOCKET; - if (e) { - apr_bucket_free(e); - } continue; } @@ -842,13 +815,6 @@ static DWORD __stdcall worker_main(void *thread_num_val) c->aborted = 1; } - if (e && c->aborted) { - apr_bucket_free(e); - } - else { - ap_set_module_config(c->conn_config, &mpm_winnt_module, context); - } - if (!c->aborted) { ap_run_process_connection(c); } diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 67c521199c..0ca2ad3362 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -1768,8 +1768,6 @@ static void winnt_hooks(apr_pool_t *p) ap_hook_mpm(winnt_run, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_mpm_query(winnt_query, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_mpm_get_name(winnt_get_name, NULL, NULL, APR_HOOK_MIDDLE); - ap_hook_insert_network_bucket(winnt_insert_network_bucket, NULL, NULL, - APR_HOOK_MIDDLE); } AP_DECLARE_MODULE(mpm_winnt) = { diff --git a/server/mpm/winnt/mpm_winnt.h b/server/mpm/winnt/mpm_winnt.h index 0c7a385d7a..7d71a28837 100644 --- a/server/mpm/winnt/mpm_winnt.h +++ b/server/mpm/winnt/mpm_winnt.h @@ -93,9 +93,6 @@ void hold_console_open_on_error(void); /* From child.c: */ void child_main(apr_pool_t *pconf, DWORD parent_pid); -apr_status_t winnt_insert_network_bucket(conn_rec *c, - apr_bucket_brigade *bb, - apr_socket_t *socket); #endif /* APACHE_MPM_WINNT_H */ /** @} */