[Zope-Checkins] CVS: Zope/ZServer - FCGIServer.py:1.17 HTTPResponse.py:1.40 PCGIServer.py:1.23
Brian Lloyd
brian@zope.com
Mon, 15 Apr 2002 16:58:48 -0400
Update of /cvs-repository/Zope/ZServer
In directory cvs.zope.org:/tmp/cvs-serv7309
Modified Files:
FCGIServer.py HTTPResponse.py PCGIServer.py
Log Message:
Fixes for hotfix issues
=== Zope/ZServer/FCGIServer.py 1.16 => 1.17 ===
self.stderr.close()
- # The following was adapted from PCGIPipe.finish and PCGIPipe.close
- # I don't really understand it enough to know if I got it right...
- shutdown = 0
- if self.headers.get('bobo-exception-type','') == \
- 'exceptions.SystemExit':
- r = self.headers.get('bobo-exception-value','0')
- try: r=string.atoi(r)
- except: r = r and 1 or 0
- shutdown = r,
-
if not self.channel.closed:
self.channel.push_with_producer(LoggingProducer(self.channel,
self.stdout.length,
'log_request'), 0)
- if shutdown:
- sys.ZServerExitCode = shutdown[0]
+ if self._shutdownRequested():
self.channel.push(ShutdownProducer(), 0)
Wakeup(lambda: asyncore.close_all())
else:
=== Zope/ZServer/HTTPResponse.py 1.39 => 1.40 ===
lambda t=('E', id(self._request)): apply(DebugLogger.log, t)), 0)
if self._shutdown:
- try: r=self._shutdown[0]
- except: r=0
- sys.ZServerExitCode=r
self._channel.push(ShutdownProducer(), 0)
Wakeup()
else:
@@ -272,9 +269,6 @@
DebugLogger.log('E', id(self._request))
if self._shutdown:
- try: r=self._shutdown[0]
- except: r=0
- sys.ZServerExitCode=r
Wakeup(lambda: asyncore.close_all())
else:
Wakeup()
@@ -285,13 +279,8 @@
def flush(self): pass # yeah, whatever
def finish(self, response):
- if response.headers.get('bobo-exception-type', '') == \
- 'exceptions.SystemExit':
-
- r=response.headers.get('bobo-exception-value','0')
- try: r=int(r)
- except: r = r and 1 or 0
- self._shutdown=r,
+ if response._shutdownRequested():
+ self._shutdown = 1
if response.headers.get('connection','') == 'close' or \
response.headers.get('Connection','') == 'close':
self._close=1
=== Zope/ZServer/PCGIServer.py 1.22 => 1.23 ===
def finish(self, response):
- if response.headers.get('bobo-exception-type','') == \
- 'exceptions.SystemExit':
- r=response.headers.get('bobo-exception-value','0')
- try: r=string.atoi(r)
- except: r = r and 1 or 0
- self._shutdown=r,
+ if response._shutdownRequested():
+ self._shutdown = 1
self._channel.reply_code=response.status