Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

connection.run(): send error reply *after* log line so connection pro…

…blems don't interfere

http_request.__repr__(): a more useful repr
  • Loading branch information...
commit d466ebdb7f46f398611fadcf8e40262282ac1179 1 parent 936dd93
Sam Rushing authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 coro/http/server.py
View
6 coro/http/server.py
@@ -91,10 +91,11 @@ def run (self, conn, peer):
except HTTP_Upgrade:
upgrade = True
break
+ # XXX use Exception here, avoid catch/raise of coro.TimeoutError/Interrupted?
except:
tb = coro.compact_traceback()
- request.error (500, tb)
self.server.log ('error: %r request=%r tb=%r' % (self.peer, request, tb))
+ request.error (500, tb)
except (OSError, coro.TimeoutError, coro.ClosedError):
pass
finally:
@@ -160,6 +161,9 @@ def __init__ (self, client, request, headers):
if self.has_body():
self.file = http_file (headers, client.stream)
+ def __repr__ (self):
+ return '<http request from %r : %r>' % (self.peer, self.request,)
+
def wait_until_read (self):
"wait until this entire request body has been read"
if self.file:
Please sign in to comment.
Something went wrong with that request. Please try again.