Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 73831 invoked by uid 500); 12 Dec 2002 19:40:53 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 73820 invoked by uid 500); 12 Dec 2002 19:40:52 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 12 Dec 2002 19:40:52 -0000 Message-ID: <20021212194052.59799.qmail@icarus.apache.org> From: bnicholes@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server/mpm/netware mpm_netware.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N bnicholes 2002/12/12 11:40:52 Modified: os/netware util_nw.c server/mpm/netware mpm_netware.c Log: Register for the SERVERDOWN event to allow Apache to shutdown gracefully when the NetWare OS is shutdown Revision Changes Path 1.5 +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.5 diff -u -r1.4 -r1.5 --- util_nw.c 31 May 2002 17:17:40 -0000 1.4 +++ util_nw.c 12 Dec 2002 19:40:51 -0000 1.5 @@ -60,8 +60,11 @@ #include "http_log.h" #include +#include -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); + +} + 1.64 +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.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- mpm_netware.c 25 Nov 2002 17:46:26 -0000 1.63 +++ mpm_netware.c 12 Dec 2002 19:40:52 -0000 1.64 @@ -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;