Commit 0d3e7e88 authored by Brian Lloyd's avatar Brian Lloyd

Fixes for hotfix issues

parent c09326c5
......@@ -722,22 +722,11 @@ class FCGIResponse(HTTPResponse):
self.stdout.close()
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:
......
......@@ -257,9 +257,6 @@ class ChannelPipe:
self._channel.push(CallbackProducer(
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 @@ class ChannelPipe:
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 @@ class ChannelPipe:
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
......
......@@ -393,10 +393,6 @@ class PCGIPipe:
self._channel=None
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
......@@ -722,22 +722,11 @@ class FCGIResponse(HTTPResponse):
self.stdout.close()
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:
......
......@@ -257,9 +257,6 @@ class ChannelPipe:
self._channel.push(CallbackProducer(
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 @@ class ChannelPipe:
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 @@ class ChannelPipe:
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
......
......@@ -393,10 +393,6 @@ class PCGIPipe:
self._channel=None
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
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