Move initialization of connectedAt to AdvancedDispatcher
This commit is contained in:
parent
2c6f3c2fe1
commit
8cf0a0bb46
|
@ -31,6 +31,7 @@ class AdvancedDispatcher(asyncore.dispatcher):
|
||||||
def __init__(self, sock=None):
|
def __init__(self, sock=None):
|
||||||
if not hasattr(self, '_map'):
|
if not hasattr(self, '_map'):
|
||||||
asyncore.dispatcher.__init__(self, sock)
|
asyncore.dispatcher.__init__(self, sock)
|
||||||
|
self.connectedAt = 0
|
||||||
self.close_reason = None
|
self.close_reason = None
|
||||||
self.read_buf = bytearray()
|
self.read_buf = bytearray()
|
||||||
self.write_buf = bytearray()
|
self.write_buf = bytearray()
|
||||||
|
|
|
@ -113,7 +113,6 @@ class Proxy(AdvancedDispatcher):
|
||||||
self.destination = address
|
self.destination = address
|
||||||
self.isOutbound = True
|
self.isOutbound = True
|
||||||
self.fullyEstablished = False
|
self.fullyEstablished = False
|
||||||
self.connectedAt = 0
|
|
||||||
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
if BMConfigParser().safeGetBoolean(
|
if BMConfigParser().safeGetBoolean(
|
||||||
"bitmessagesettings", "socksauthentication"):
|
"bitmessagesettings", "socksauthentication"):
|
||||||
|
@ -145,6 +144,5 @@ class Proxy(AdvancedDispatcher):
|
||||||
|
|
||||||
def state_proxy_handshake_done(self):
|
def state_proxy_handshake_done(self):
|
||||||
"""Handshake is complete at this point"""
|
"""Handshake is complete at this point"""
|
||||||
# pylint: disable=attribute-defined-outside-init
|
|
||||||
self.connectedAt = time.time()
|
self.connectedAt = time.time()
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -51,7 +51,6 @@ class TCPConnection(BMProto, TLSDispatcher):
|
||||||
self.verackSent = False
|
self.verackSent = False
|
||||||
self.streams = [0]
|
self.streams = [0]
|
||||||
self.fullyEstablished = False
|
self.fullyEstablished = False
|
||||||
self.connectedAt = 0
|
|
||||||
self.skipUntil = 0
|
self.skipUntil = 0
|
||||||
if address is None and sock is not None:
|
if address is None and sock is not None:
|
||||||
self.destination = Peer(*sock.getpeername())
|
self.destination = Peer(*sock.getpeername())
|
||||||
|
|
|
@ -28,7 +28,6 @@ class UDPSocket(BMProto): # pylint: disable=too-many-instance-attributes
|
||||||
# .. todo:: sort out streams
|
# .. todo:: sort out streams
|
||||||
self.streams = [1]
|
self.streams = [1]
|
||||||
self.fullyEstablished = True
|
self.fullyEstablished = True
|
||||||
self.connectedAt = 0
|
|
||||||
self.skipUntil = 0
|
self.skipUntil = 0
|
||||||
if sock is None:
|
if sock is None:
|
||||||
if host is None:
|
if host is None:
|
||||||
|
|
Reference in New Issue
Block a user