]> granicus.if.org Git - apache/commitdiff
Finally, back working on the MPM... Eliminate DOS hole. I can see no easy way
authorBill Stoddard <stoddard@apache.org>
Tue, 1 Feb 2000 00:34:05 +0000 (00:34 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 1 Feb 2000 00:34:05 +0000 (00:34 +0000)
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

server/mpm/winnt/mpm_winnt.c

index 91bd9ed582e92a1c0da88bc04825aa4bcbb06fed..d4d76c4fe1fabeabb4f805abcb921fbc8232a7ed 100644 (file)
@@ -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,