Commit 53337d6b authored by Denis Bilenko's avatar Denis Bilenko

http: do not silent HttpRequestDeleted in reply_error(), instead don't call it...

http: do not silent HttpRequestDeleted in reply_error(), instead don't call it at all if the request was deleted
parent e5caef0c
...@@ -117,14 +117,12 @@ class HTTPServer(object): ...@@ -117,14 +117,12 @@ class HTTPServer(object):
sys.stderr.write('Failed to handle request: %s\n\n' % (request, )) sys.stderr.write('Failed to handle request: %s\n\n' % (request, ))
except: except:
pass pass
self.reply_error(request) if request:
self.reply_error(request)
def reply_error(self, request): def reply_error(self, request):
try: if request.response == (0, None):
if request.response == (0, None): request.send_reply(500, 'Internal Server Error', '<h1>Internal Server Error</h1>')
request.send_reply(500, 'Internal Server Error', '<h1>Internal Server Error</h1>')
except core.HttpRequestDeleted:
pass
def serve_forever(self, *args, **kwargs): def serve_forever(self, *args, **kwargs):
stop_timeout = kwargs.pop('stop_timeout', 0) stop_timeout = kwargs.pop('stop_timeout', 0)
......
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