You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@hyperreal.org on 2000/02/01 01:34:11 UTC
cvs commit: apache-2.0/src/modules/mpm/winnt winnt.c
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,