Commit c9f3de33 authored by Denis Bilenko's avatar Denis Bilenko

pywsgi.py: log something sensible if log_request() was called before request was finished

--HG--
extra : transplant_source : %CB%3A%22%D7%8F%8E%9C%C2%81L%8C%CA%8C%E0%BF6%1C%12%8E%8E
parent 967c51b9
......@@ -368,13 +368,20 @@ class WSGIHandler(object):
def format_request(self):
now = datetime.now().replace(microsecond=0)
return '%s - - [%s] "%s" %s %s %.6f' % (
if self.time_finish:
delta = '%.6f' % (self.time_finish - self.time_start)
length = self.response_length
else:
delta = '-'
if not self.response_length:
length = '-'
return '%s - - [%s] "%s" %s %s %s' % (
self.client_address[0],
now,
self.requestline,
(self.status or '000').split()[0],
self.response_length,
self.time_finish - self.time_start)
length,
delta)
def run_application(self):
self.result = self.application(self.environ, self.start_response)
......
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