Create a Connection only once and avoid no-op if was "connected"

This commit is contained in:
Lonami Exo
2017-09-21 13:43:33 +02:00
parent 4777b8dad4
commit 2b2da843a1
6 changed files with 38 additions and 44 deletions

View File

@@ -93,6 +93,9 @@ class Connection:
elif self._mode == ConnectionMode.TCP_OBFUSCATED:
self._setup_obfuscation()
def get_timeout(self):
return self.conn.timeout
def _setup_obfuscation(self):
# Obfuscated messages secrets cannot start with any of these
keywords = (b'PVrG', b'GET ', b'POST', b'\xee' * 4)