Return-Path: Delivered-To: apache-cvs-archive@hyperreal.org Received: (qmail 13293 invoked by uid 6000); 1 Feb 2000 00:34:18 -0000 Received: (qmail 13106 invoked by uid 2016); 1 Feb 2000 00:34:13 -0000 Delivered-To: apcore-apache-2.0-cvs@apache.org Received: (qmail 13044 invoked by uid 215); 1 Feb 2000 00:34:11 -0000 Date: 1 Feb 2000 00:34:11 -0000 Message-ID: <20000201003411.13043.qmail@hyperreal.org> From: stoddard@hyperreal.org To: apache-2.0-cvs@apache.org Subject: cvs commit: apache-2.0/src/modules/mpm/winnt winnt.c Sender: apache-cvs-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org stoddard 00/01/31 16:34:10 Modified: src/modules/mpm/winnt winnt.c Log: 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. Revision Changes Path 1.37 +6 -5 apache-2.0/src/modules/mpm/winnt/winnt.c Index: winnt.c =================================================================== RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/winnt.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- winnt.c 2000/01/27 05:57:57 1.36 +++ winnt.c 2000/02/01 00:34:05 1.37 @@ -971,7 +971,8 @@ /* 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 @@ 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 @@ 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 @@ &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 @@ /* 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,