httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stodd...@locus.apache.org
Subject cvs commit: apache-2.0/src/modules/mpm/winnt mpm_winnt.c
Date Thu, 09 Nov 2000 19:17:51 GMT
stoddard    00/11/09 11:17:51

  Modified:    src/modules/mpm/winnt mpm_winnt.c
  Log:
  Eliminate use of BUFF in mpm_winnt. Thanks to rbb for pointing this out.
  
  Revision  Changes    Path
  1.110     +16 -8     apache-2.0/src/modules/mpm/winnt/mpm_winnt.c
  
  Index: mpm_winnt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/mpm/winnt/mpm_winnt.c,v
  retrieving revision 1.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- mpm_winnt.c	2000/11/03 04:34:42	1.109
  +++ mpm_winnt.c	2000/11/09 19:17:51	1.110
  @@ -884,15 +884,20 @@
   
       apr_create_pool(&context->ptrans, _pconf);
       context->conn_io = ap_bcreate(context->ptrans, B_RDWR);
  -    context->recv_buf = context->conn_io->inbase;
  -    context->recv_buf_size = context->conn_io->bufsiz - 2*PADDED_ADDR_SIZE;
   
  +    /* recv_buf must be large enough to hold the remote and local
  +     * addresses. Note that recv_buf_size is the amount of recv_buf
  +     * available for AcceptEx to receive bytes into. Since we 
  +     * don't want AcceptEx to do a recv, set the size to 0.
  +     */
  +    context->recv_buf = apr_pcalloc(_pconf, 2*PADDED_ADDR_SIZE);
  +    context->recv_buf_size = 0;
   
       /* 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, 
  -                  0, //context->recv_buf_size,
  +                  context->recv_buf_size,
                     PADDED_ADDR_SIZE, PADDED_ADDR_SIZE,
                     &BytesRead,
                     (LPOVERLAPPED) context)) {
  @@ -918,8 +923,6 @@
       apr_clear_pool(context->ptrans);
       context->sock = NULL;
       context->conn_io = ap_bcreate(context->ptrans, B_RDWR);
  -    context->recv_buf = context->conn_io->inbase;
  -    context->recv_buf_size = context->conn_io->bufsiz - 2*PADDED_ADDR_SIZE;
   
       /* recreate and initialize the accept socket if it is not being reused */
       apr_get_os_sock(&nsd, context->lr->sd);
  @@ -951,9 +954,14 @@
               }
           }
   
  -        if (!AcceptEx(nsd, context->accept_socket, context->recv_buf, 0,
  -                      PADDED_ADDR_SIZE, PADDED_ADDR_SIZE, &BytesRead, 
  +        if (!AcceptEx(nsd, context->accept_socket, 
  +                      context->recv_buf,                   
  +                      context->recv_buf_size,
  +                      PADDED_ADDR_SIZE, 
  +                      PADDED_ADDR_SIZE, 
  +                      &BytesRead, 
                         (LPOVERLAPPED) context)) {
  +
               rc = apr_get_netos_error();
               if (rc != APR_FROM_OS_ERROR(ERROR_IO_PENDING)) {
                   ap_log_error(APLOG_MARK, APLOG_INFO, rc, server_conf,
  @@ -1086,7 +1094,7 @@
       /* Received a connection */
       context->conn_io->incnt = BytesRead;
       GetAcceptExSockaddrs(context->recv_buf, 
  -                         0, //context->recv_buf_size,
  +                         context->recv_buf_size,
                            PADDED_ADDR_SIZE,
                            PADDED_ADDR_SIZE,
                            &context->sa_server,
  
  
  

Mime
View raw message