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 winnt.c
Date Thu, 27 Apr 2000 14:59:50 GMT
stoddard    00/04/27 07:59:50

  Modified:    src      CHANGES
               src/lib/apr/misc/win32 start.c
               src/modules/mpm/winnt winnt.c
  Log:
  Eliminate redundant calls to initialize the Winsock.
  
  Submitted by:	Tim Costello
  
  Revision  Changes    Path
  1.85      +3 -0      apache-2.0/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/CHANGES,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- CHANGES	2000/04/27 11:19:28	1.84
  +++ CHANGES	2000/04/27 14:59:49	1.85
  @@ -1,4 +1,7 @@
   Changes with Apache 2.0a3-dev
  +  *) Win32: Eliminate redundant calls to initialize winsock.
  +     [Tim Costello <timcostello@ozemail.com.au>]
  +
     *) Fix bugs initializing ungetchar for pipes. 
        [Chia-liang Kao <clkao@CirX.ORG>]
   
  
  
  
  1.27      +16 -15    apache-2.0/src/lib/apr/misc/win32/start.c
  
  Index: start.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/misc/win32/start.c,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- start.c	2000/04/22 06:16:37	1.26
  +++ start.c	2000/04/27 14:59:49	1.27
  @@ -64,16 +64,12 @@
   
   ap_status_t clean_cont(void *data)
   {
  -    WSACleanup();
       return APR_SUCCESS;
   }
       
   
   ap_status_t ap_create_pool(ap_pool_t **newcont, ap_pool_t *cont)
   {
  -    int iVersionRequested;
  -    WSADATA wsaData;
  -    int err;
       ap_pool_t *new;
   
       if (cont) {
  @@ -90,17 +86,6 @@
       new->prog_data = NULL;
       new->apr_abort = NULL;
   
  -    iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte);
  -    err = WSAStartup((WORD) iVersionRequested, &wsaData);
  -    if (err) {
  -        return APR_EEXIST;
  -    }
  -    if (LOBYTE(wsaData.wVersion) != WSAHighByte ||
  -        HIBYTE(wsaData.wVersion) != WSALowByte) {
  -        WSACleanup();
  -        return APR_EEXIST;
  -    }
  -
       *newcont = new;
       return APR_SUCCESS;
   }
  @@ -249,6 +234,9 @@
   ap_status_t ap_initialize(void)
   {
       ap_status_t status;
  +    int iVersionRequested;
  +    WSADATA wsaData;
  +    int err;
   #if 0
       unsigned tid;
   
  @@ -260,11 +248,24 @@
           sleep(1);
       }
   #endif
  +
  +    iVersionRequested = MAKEWORD(WSAHighByte, WSALowByte);
  +    err = WSAStartup((WORD) iVersionRequested, &wsaData);
  +    if (err) {
  +        return APR_EEXIST;
  +    }
  +    if (LOBYTE(wsaData.wVersion) != WSAHighByte ||
  +        HIBYTE(wsaData.wVersion) != WSALowByte) {
  +        WSACleanup();
  +        return APR_EEXIST;
  +    }
  +
       status = ap_init_alloc();
       return status;
   }
   
   void ap_terminate(void)
   {
  +    WSACleanup();
       ap_term_alloc();
   }
  
  
  
  1.59      +0 -43     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.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- winnt.c	2000/04/26 00:36:49	1.58
  +++ winnt.c	2000/04/27 14:59:50	1.59
  @@ -327,45 +327,7 @@
   /*
    * Routines that deal with sockets, some are WIN32 specific...
    */
  -static int s_iInitCount = 0;
  -static int AMCSocketInitialize(void)
  -{
  -    int iVersionRequested;
  -    WSADATA wsaData;
  -    int err;
  -
  -    if (s_iInitCount > 0) {
  -	s_iInitCount++;
  -	return (0);
  -    }
  -    else if (s_iInitCount < 0)
  -	return (s_iInitCount);
  -
  -    /* s_iInitCount == 0. Do the initailization */
  -    iVersionRequested = MAKEWORD(2, 0);
  -    err = WSAStartup((WORD) iVersionRequested, &wsaData);
  -    if (err) {
  -	s_iInitCount = -1;
  -	return (s_iInitCount);
  -    }
  -    if (LOBYTE(wsaData.wVersion) != 1 ||
  -	HIBYTE(wsaData.wVersion) != 1) {
  -	s_iInitCount = -2;
  -	WSACleanup();
  -	return (s_iInitCount);
  -    }
   
  -    s_iInitCount++;
  -    return (s_iInitCount);
  -
  -}
  -static void AMCSocketCleanup(void)
  -{
  -    if (--s_iInitCount == 0)
  -	WSACleanup();
  -    return;
  -}
  -
   static void sock_disable_nagle(int s) 
   {
       /* The Nagle algorithm says that we should delay sending partial
  @@ -1744,8 +1706,6 @@
               ap_log_pid(pconf, ap_pid_fname);
               service_set_status(SERVICE_START_PENDING);
   
  -            AMCSocketInitialize();
  -        
               /* Create shutdown event, apPID_shutdown, where PID is the parent 
                * Apache process ID. Shutdown is signaled by 'apache -k shutdown'.
                */
  @@ -1791,9 +1751,7 @@
           /* Running as Child process or in one_process (debug) mode */
           ap_log_error(APLOG_MARK, APLOG_INFO, APR_SUCCESS, server_conf,
                        "Child %d: Child process is running", my_pid);
  -        AMCSocketInitialize();
           child_main();
  -        AMCSocketCleanup();
           ap_log_error(APLOG_MARK, APLOG_INFO, APR_SUCCESS, server_conf,
                        "Child %d: Child process is exiting", my_pid);        
   
  @@ -1815,7 +1773,6 @@
   
               CloseHandle(restart_event);
               CloseHandle(shutdown_event);
  -            AMCSocketCleanup();
   
               service_set_status(SERVICE_STOPPED);
   
  
  
  

Mime
View raw message