Commit ae2c1d38 authored by Hanno Schlichting's avatar Hanno Schlichting

Move _requestShutdown logic into ZServer.

parent 5a54bdff
...@@ -556,20 +556,15 @@ class HTTPResponse(BaseResponse): ...@@ -556,20 +556,15 @@ class HTTPResponse(BaseResponse):
return str(location) return str(location)
# The following two methods are part of a private protocol with the # The following two methods are part of a private protocol with
# publisher for handling fatal import errors and TTW shutdown requests. # ZServer for handling fatal import errors.
_shutdown_flag = None _shutdown_flag = None
def _requestShutdown(self, exitCode=0): def _requestShutdown(self, exitCode=0):
""" Request that the server shut down with exitCode after fulfilling """ Request that the server shut down with exitCode after fulfilling
the current request. the current request.
""" """
self._shutdown_flag = 1 self._shutdown_flag = exitCode
try:
from ZServer.Zope2.Startup import config
config.ZSERVER_EXIT_CODE = exitCode
except ImportError:
pass
def _shutdownRequested(self): def _shutdownRequested(self):
""" Returns true if this request requested a server shutdown. """ Returns true if this request requested a server shutdown.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment