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

Fixes for hotfix issues

parent c09326c5
...@@ -722,22 +722,11 @@ class FCGIResponse(HTTPResponse): ...@@ -722,22 +722,11 @@ class FCGIResponse(HTTPResponse):
self.stdout.close() self.stdout.close()
self.stderr.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: if not self.channel.closed:
self.channel.push_with_producer(LoggingProducer(self.channel, self.channel.push_with_producer(LoggingProducer(self.channel,
self.stdout.length, self.stdout.length,
'log_request'), 0) 'log_request'), 0)
if shutdown: if self._shutdownRequested():
sys.ZServerExitCode = shutdown[0]
self.channel.push(ShutdownProducer(), 0) self.channel.push(ShutdownProducer(), 0)
Wakeup(lambda: asyncore.close_all()) Wakeup(lambda: asyncore.close_all())
else: else:
......
...@@ -257,9 +257,6 @@ class ChannelPipe: ...@@ -257,9 +257,6 @@ class ChannelPipe:
self._channel.push(CallbackProducer( self._channel.push(CallbackProducer(
lambda t=('E', id(self._request)): apply(DebugLogger.log, t)), 0) lambda t=('E', id(self._request)): apply(DebugLogger.log, t)), 0)
if self._shutdown: if self._shutdown:
try: r=self._shutdown[0]
except: r=0
sys.ZServerExitCode=r
self._channel.push(ShutdownProducer(), 0) self._channel.push(ShutdownProducer(), 0)
Wakeup() Wakeup()
else: else:
...@@ -272,9 +269,6 @@ class ChannelPipe: ...@@ -272,9 +269,6 @@ class ChannelPipe:
DebugLogger.log('E', id(self._request)) DebugLogger.log('E', id(self._request))
if self._shutdown: if self._shutdown:
try: r=self._shutdown[0]
except: r=0
sys.ZServerExitCode=r
Wakeup(lambda: asyncore.close_all()) Wakeup(lambda: asyncore.close_all())
else: else:
Wakeup() Wakeup()
...@@ -285,13 +279,8 @@ class ChannelPipe: ...@@ -285,13 +279,8 @@ class ChannelPipe:
def flush(self): pass # yeah, whatever def flush(self): pass # yeah, whatever
def finish(self, response): def finish(self, response):
if response.headers.get('bobo-exception-type', '') == \ if response._shutdownRequested():
'exceptions.SystemExit': self._shutdown = 1
r=response.headers.get('bobo-exception-value','0')
try: r=int(r)
except: r = r and 1 or 0
self._shutdown=r,
if response.headers.get('connection','') == 'close' or \ if response.headers.get('connection','') == 'close' or \
response.headers.get('Connection','') == 'close': response.headers.get('Connection','') == 'close':
self._close=1 self._close=1
......
...@@ -393,10 +393,6 @@ class PCGIPipe: ...@@ -393,10 +393,6 @@ class PCGIPipe:
self._channel=None self._channel=None
def finish(self, response): def finish(self, response):
if response.headers.get('bobo-exception-type','') == \ if response._shutdownRequested():
'exceptions.SystemExit': self._shutdown = 1
r=response.headers.get('bobo-exception-value','0')
try: r=string.atoi(r)
except: r = r and 1 or 0
self._shutdown=r,
self._channel.reply_code=response.status self._channel.reply_code=response.status
...@@ -722,22 +722,11 @@ class FCGIResponse(HTTPResponse): ...@@ -722,22 +722,11 @@ class FCGIResponse(HTTPResponse):
self.stdout.close() self.stdout.close()
self.stderr.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: if not self.channel.closed:
self.channel.push_with_producer(LoggingProducer(self.channel, self.channel.push_with_producer(LoggingProducer(self.channel,
self.stdout.length, self.stdout.length,
'log_request'), 0) 'log_request'), 0)
if shutdown: if self._shutdownRequested():
sys.ZServerExitCode = shutdown[0]
self.channel.push(ShutdownProducer(), 0) self.channel.push(ShutdownProducer(), 0)
Wakeup(lambda: asyncore.close_all()) Wakeup(lambda: asyncore.close_all())
else: else:
......
...@@ -257,9 +257,6 @@ class ChannelPipe: ...@@ -257,9 +257,6 @@ class ChannelPipe:
self._channel.push(CallbackProducer( self._channel.push(CallbackProducer(
lambda t=('E', id(self._request)): apply(DebugLogger.log, t)), 0) lambda t=('E', id(self._request)): apply(DebugLogger.log, t)), 0)
if self._shutdown: if self._shutdown:
try: r=self._shutdown[0]
except: r=0
sys.ZServerExitCode=r
self._channel.push(ShutdownProducer(), 0) self._channel.push(ShutdownProducer(), 0)
Wakeup() Wakeup()
else: else:
...@@ -272,9 +269,6 @@ class ChannelPipe: ...@@ -272,9 +269,6 @@ class ChannelPipe:
DebugLogger.log('E', id(self._request)) DebugLogger.log('E', id(self._request))
if self._shutdown: if self._shutdown:
try: r=self._shutdown[0]
except: r=0
sys.ZServerExitCode=r
Wakeup(lambda: asyncore.close_all()) Wakeup(lambda: asyncore.close_all())
else: else:
Wakeup() Wakeup()
...@@ -285,13 +279,8 @@ class ChannelPipe: ...@@ -285,13 +279,8 @@ class ChannelPipe:
def flush(self): pass # yeah, whatever def flush(self): pass # yeah, whatever
def finish(self, response): def finish(self, response):
if response.headers.get('bobo-exception-type', '') == \ if response._shutdownRequested():
'exceptions.SystemExit': self._shutdown = 1
r=response.headers.get('bobo-exception-value','0')
try: r=int(r)
except: r = r and 1 or 0
self._shutdown=r,
if response.headers.get('connection','') == 'close' or \ if response.headers.get('connection','') == 'close' or \
response.headers.get('Connection','') == 'close': response.headers.get('Connection','') == 'close':
self._close=1 self._close=1
......
...@@ -393,10 +393,6 @@ class PCGIPipe: ...@@ -393,10 +393,6 @@ class PCGIPipe:
self._channel=None self._channel=None
def finish(self, response): def finish(self, response):
if response.headers.get('bobo-exception-type','') == \ if response._shutdownRequested():
'exceptions.SystemExit': self._shutdown = 1
r=response.headers.get('bobo-exception-value','0')
try: r=string.atoi(r)
except: r = r and 1 or 0
self._shutdown=r,
self._channel.reply_code=response.status 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