Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[trivial] Output a peer name to log message on ssl errors #560

Merged
merged 2 commits into from

2 participants

@ei-grad

It is uniformative to have only fd number in log records on such errors.

@bdarnell bdarnell merged commit b5288cf into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 9, 2012
  1. @ei-grad
  2. @ei-grad

    formatting

    ei-grad authored
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 tornado/iostream.py
View
7 tornado/iostream.py
@@ -650,7 +650,12 @@ def _do_ssl_handshake(self):
ssl.SSL_ERROR_ZERO_RETURN):
return self.close()
elif err.args[0] == ssl.SSL_ERROR_SSL:
- logging.warning("SSL Error on %d: %s", self.socket.fileno(), err)
+ try:
+ peer = self.socket.getpeername()
+ except:
+ peer = '(not connected)'
+ logging.warning("SSL Error on %d %s: %s",
+ self.socket.fileno(), peer, err)
return self.close()
raise
except socket.error, err:
Something went wrong with that request. Please try again.