httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject cvs commit: httpd-2.0/server/mpm/netware mpm_netware.c
Date Thu, 12 Dec 2002 19:41:56 GMT
bnicholes    2002/12/12 11:41:56

  Modified:    os/netware Tag: APACHE_2_0_BRANCH util_nw.c
               server/mpm/netware Tag: APACHE_2_0_BRANCH mpm_netware.c
  Log:
  Register for the SERVERDOWN event to allow Apache to shutdown gracefully
  when the NetWare OS is shutdown
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +61 -2     httpd-2.0/os/netware/util_nw.c
  
  Index: util_nw.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/os/netware/util_nw.c,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- util_nw.c	31 May 2002 17:17:40 -0000	1.4
  +++ util_nw.c	12 Dec 2002 19:41:55 -0000	1.4.2.1
  @@ -60,8 +60,11 @@
   #include "http_log.h"
   
   #include <netware.h>
  +#include <nks\netware.h>
   
  -int nlmUnloadSignaled();
  +int nlmUnloadSignaled(int wait);
  +event_handle_t eh;
  +Warn_t ref;
   
   AP_DECLARE(apr_status_t) ap_os_create_privileged_process(
       const request_rec *r,
  @@ -75,5 +78,61 @@
   
   int  _NonAppCheckUnload( void )
   {
  -	return nlmUnloadSignaled();
  +	return nlmUnloadSignaled(1);
   }
  +
  +// down server event callback
  +void ap_down_server_cb(void *, void *)
  +{
  +	nlmUnloadSignaled(0);
  +    return;
  +}
  +
  +// destroy callback resources
  +void ap_cb_destroy(void *)
  +{
  +  // cleanup down event notification
  +  UnRegisterEventNotification(eh);
  +  NX_UNWRAP_INTERFACE(ref);
  +}
  +
  +int _NonAppStart
  +(
  +    void        *NLMHandle,
  +    void        *errorScreen,
  +    const char  *cmdLine,
  +    const char  *loadDirPath,
  +    size_t      uninitializedDataLength,
  +    void        *NLMFileHandle,
  +    int         (*readRoutineP)( int conn, void *fileHandle, size_t offset,
  +                    size_t nbytes, size_t *bytesRead, void *buffer ),
  +    size_t      customDataOffset,
  +    size_t      customDataSize,
  +    int         messageCount,
  +    const char  **messages
  +)
  +{
  +#pragma unused(cmdLine)
  +#pragma unused(loadDirPath)
  +#pragma unused(uninitializedDataLength)
  +#pragma unused(NLMFileHandle)
  +#pragma unused(readRoutineP)
  +#pragma unused(customDataOffset)
  +#pragma unused(customDataSize)
  +#pragma unused(messageCount)
  +#pragma unused(messages)
  +
  +    // register for down server event
  +    rtag_t rt = AllocateResourceTag(NLMHandle, "Apache2 Down Server Callback",
  +                                    EventSignature);
  +
  +    NX_WRAP_INTERFACE((void *)ap_down_server_cb, 2, (void **)&ref);
  +    eh = RegisterForEventNotification(rt, EVENT_DOWN_SERVER,
  +                                      EVENT_PRIORITY_APPLICATION,
  +                                      ref, NULL, NULL);
  +
  +    // clean-up
  +    NXVmRegisterExitHandler(ap_cb_destroy, NULL);
  +
  +}
  +
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.62.2.2  +5 -3      httpd-2.0/server/mpm/netware/mpm_netware.c
  
  Index: mpm_netware.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/mpm/netware/mpm_netware.c,v
  retrieving revision 1.62.2.1
  retrieving revision 1.62.2.2
  diff -u -r1.62.2.1 -r1.62.2.2
  --- mpm_netware.c	2 Dec 2002 15:41:55 -0000	1.62.2.1
  +++ mpm_netware.c	12 Dec 2002 19:41:55 -0000	1.62.2.2
  @@ -318,12 +318,14 @@
       apr_signal(SIGABRT, sig_term);
   }
   
  -int nlmUnloadSignaled()
  +int nlmUnloadSignaled(int wait)
   {
       shutdown_pending = 1;
   
  -    while (wait_to_finish) {
  -        NXThreadYield();
  +    if (wait) {
  +        while (wait_to_finish) {
  +            NXThreadYield();
  +        }
       }
   
       return 0;
  
  
  

Mime
View raw message