Skip to content
This repository
Browse code

Merge pull request #560 from ei-grad/master

[trivial] Output a peer name to log message on ssl errors
  • Loading branch information...
commit b5288cf0af28fe89a04a92d454399895cee0f8d2 2 parents 5edd8da + 3b56036
Ben Darnell authored July 14, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  tornado/iostream.py
7  tornado/iostream.py
@@ -650,7 +650,12 @@ def _do_ssl_handshake(self):
650 650
                                  ssl.SSL_ERROR_ZERO_RETURN):
651 651
                 return self.close()
652 652
             elif err.args[0] == ssl.SSL_ERROR_SSL:
653  
-                logging.warning("SSL Error on %d: %s", self.socket.fileno(), err)
  653
+                try:
  654
+                    peer = self.socket.getpeername()
  655
+                except:
  656
+                    peer = '(not connected)'
  657
+                logging.warning("SSL Error on %d %s: %s",
  658
+                                self.socket.fileno(), peer, err)
654 659
                 return self.close()
655 660
             raise
656 661
         except socket.error, err:

0 notes on commit b5288cf

Please sign in to comment.
Something went wrong with that request. Please try again.