From: Bill Stoddard Date: Tue, 1 Feb 2000 00:34:05 +0000 (+0000) Subject: Finally, back working on the MPM... Eliminate DOS hole. I can see no easy way X-Git-Tag: 1.3.12~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3956182185977e4181b3ba098de795e2e3502574;p=apache Finally, back working on the MPM... Eliminate DOS hole. I can see no easy way to time out AcceptEx (a.k.a., accept_and_receive) when a connection is received but no data is sent. So, make AcceptEx just do an accept and leave the receive to the other Apache code. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@84550 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 91bd9ed582..d4d76c4fe1 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -971,7 +971,8 @@ static int create_acceptex_context(ap_context_t *_pconf, ap_listen_rec *lr) /* AcceptEx on the completion context. The completion context will be signaled * when a connection is accepted. */ if (!AcceptEx(nsd, context->accept_socket, - context->recv_buf, context->recv_buf_size, + context->recv_buf, + 0, //context->recv_buf_size, PADDED_ADDR_SIZE, PADDED_ADDR_SIZE, &BytesRead, (LPOVERLAPPED) context)) { @@ -1011,7 +1012,8 @@ static ap_inline int reset_acceptex_context(PCOMP_CONTEXT context) ap_get_os_sock(&nsd, context->lr->sd); if (!AcceptEx(nsd, context->accept_socket, - context->recv_buf, context->recv_buf_size, + context->recv_buf, + 0, //context->recv_buf_size, PADDED_ADDR_SIZE, PADDED_ADDR_SIZE, &BytesRead, (LPOVERLAPPED) context)) { lasterror = WSAGetLastError(); @@ -1031,7 +1033,6 @@ static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT context) LPOVERLAPPED pol; DWORD CompKey; DWORD BytesRead; - int lastError; if (context != NULL) { /* If child shutdown has been signaled, clean-up the completion context */ @@ -1057,7 +1058,7 @@ static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT context) &pol, INFINITE); if (!rc) { - ap_log_error(APLOG_MARK,APLOG_ERR, lastError, server_conf, + ap_log_error(APLOG_MARK,APLOG_ERR, GetLastError(), server_conf, "Child: %d - GetQueuedCompletionStatus() failed", my_pid); continue; } @@ -1086,7 +1087,7 @@ static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT context) /* Received a connection */ context->conn_io->incnt = BytesRead; GetAcceptExSockaddrs(context->recv_buf, - context->recv_buf_size, + 0, //context->recv_buf_size, PADDED_ADDR_SIZE, PADDED_ADDR_SIZE, &context->sa_server,