Reduce severity of socks connectivity errors

- Fixes #1024
- Fixes #1019
This commit is contained in:
Peter Šurda 2017-07-05 09:07:00 +02:00
parent 773d91bbe2
commit 9d09f9f3ce
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
2 changed files with 12 additions and 0 deletions

View File

@ -84,6 +84,12 @@ class Socks4aConnection(Socks4a):
self.writeQueue.put(self.destination[0] + chr(0x00).encode())
self.set_state("pre_connect", 0)
def state_pre_connect(self):
try:
Socks4a.state_pre_connect(self)
except Socks4aError as e:
self.handle_close(e.message)
class Socks4aResolver(Socks4a):
def __init__(self, host):

View File

@ -156,6 +156,12 @@ class Socks5Connection(Socks5):
self.writeQueue.put(struct.pack(">H", self.destination[1]))
self.set_state("pre_connect", 0)
def state_pre_connect(self):
try:
Socks5.state_pre_connect(self)
except Socks5Error as e:
self.handle_close(e.message)
class Socks5Resolver(Socks5):
def __init__(self, host):