This commit is contained in:
Maximilian Hils
2014-08-18 00:55:30 +02:00
parent 623cbd4e51
commit 5b7e19a77e
2 changed files with 39 additions and 0 deletions

View File

@@ -22,6 +22,13 @@ class ClientConnection(tcp.BaseHandler, stateobject.SimpleStateObject):
self.timestamp_end = None
self.timestamp_ssl_setup = None
def __repr__(self):
return "<ClientConnection: {ssl}{host}:{port}>".format(
ssl="[ssl] " if self.ssl_established else "",
host=self.address.host,
port=self.address.port
)
_stateobject_attributes = dict(
timestamp_start=float,
timestamp_end=float,
@@ -76,6 +83,19 @@ class ServerConnection(tcp.TCPClient, stateobject.SimpleStateObject):
self.timestamp_tcp_setup = None
self.timestamp_ssl_setup = None
def __repr__(self):
if self.ssl_established and self.sni:
ssl = "[ssl: {0}] ".format(self.sni)
elif self.ssl_established:
ssl = "[ssl] "
else:
ssl = ""
return "<ServerConnection: {ssl}{host}:{port}>".format(
ssl=ssl,
host=self.address.host,
port=self.address.port
)
_stateobject_attributes = dict(
state=list,
peername=tuple,