httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/winnt child.c
Date Sun, 04 Aug 2002 18:44:52 GMT
wrowe       2002/08/04 11:44:52

  Modified:    server/mpm/winnt child.c
  Log:
    Lots o bugs and emits here.  accept_socket is a handle, although vc and
    the psdk aren't good about remembering that.  never use GetLastError()
    to ap_log_error.  remember that we could have a socket closed by our
    neighbor while we were blocking.
  
  Revision  Changes    Path
  1.4       +8 -3      httpd-2.0/server/mpm/winnt/child.c
  
  Index: child.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/child.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- child.c	4 Aug 2002 18:25:47 -0000	1.3
  +++ child.c	4 Aug 2002 18:44:52 -0000	1.4
  @@ -543,11 +543,16 @@
               while (1) {
                   rv = WaitForSingleObject(context->Overlapped.hEvent, 1000);
                   if (rv == WAIT_OBJECT_0) {
  -                    if (!GetOverlappedResult(context->accept_socket, 
  +                    if (context->accept_socket == -1) {
  +                        /* socket already closed */
  +                        break;
  +                    }
  +                    if (!GetOverlappedResult((HANDLE)context->accept_socket, 
                                                &context->Overlapped, 
                                                &BytesRead, FALSE)) {
  -                        ap_log_error(APLOG_MARK,APLOG_WARNING, GetLastError(), ap_server_conf,
  -                                     "winnt_accept: Asynchronous AcceptEx failed.");
  +                        ap_log_error(APLOG_MARK, APLOG_WARNING, 
  +                                     apr_get_os_error(), ap_server_conf,
  +                             "winnt_accept: Asynchronous AcceptEx failed.");
                           closesocket(context->accept_socket);
                           context->accept_socket = INVALID_SOCKET;
                       }
  
  
  

Mime
View raw message