httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r775266 - /httpd/httpd/trunk/server/mpm/winnt/service.c
Date Fri, 15 May 2009 18:03:45 GMT
Author: wrowe
Date: Fri May 15 18:03:44 2009
New Revision: 775266

URL: http://svn.apache.org/viewvc?rev=775266&view=rev
Log:
Pick up earlier SHUTDOWN notification

Modified:
    httpd/httpd/trunk/server/mpm/winnt/service.c

Modified: httpd/httpd/trunk/server/mpm/winnt/service.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/service.c?rev=775266&r1=775265&r2=775266&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/service.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/service.c Fri May 15 18:03:44 2009
@@ -254,9 +254,10 @@
     if (globdat.hServiceStatus)
     {
         if (currentState == SERVICE_RUNNING) {
-            globdat.ssStatus.dwWaitHint = 0;
-            globdat.ssStatus.dwCheckPoint = 0;
-            globdat.ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
+            ctx->ssStatus.dwWaitHint = 0;
+            ctx->ssStatus.dwCheckPoint = 0;
+            ctx->ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP
+                                             | SERVICE_ACCEPT_SHUTDOWN;
         }
         else if (currentState == SERVICE_STOPPED) {
             globdat.ssStatus.dwWaitHint = 0;
@@ -331,7 +332,9 @@
 
 static VOID WINAPI service_nt_ctrl(DWORD dwCtrlCode)
 {
-    if (dwCtrlCode == SERVICE_CONTROL_STOP)
+    /* SHUTDOWN is offered before STOP, accept the first opportunity */
+    if ((dwCtrlCode == SERVICE_CONTROL_STOP)
+         || (dwCtrlCode == SERVICE_CONTROL_SHUTDOWN))
     {
         ap_signal_parent(SIGNAL_PARENT_SHUTDOWN);
         ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 30000);



Mime
View raw message