From 79d1b1b9e281037aca05db78dc174a87c8af6c33 Mon Sep 17 00:00:00 2001 From: lakshyacis Date: Tue, 10 Sep 2019 14:51:02 +0530 Subject: [PATCH] socks4a pylint fixes --- src/network/socks4a.py | 8 +++++++- src/network/udp.py | 5 +---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/network/socks4a.py b/src/network/socks4a.py index bdf59944..f0b234f5 100644 --- a/src/network/socks4a.py +++ b/src/network/socks4a.py @@ -1,3 +1,8 @@ +""" +src/network/socks4a.py +================================= +""" +# pylint: disable=attribute-defined-outside-init import socket import struct @@ -82,7 +87,7 @@ class Socks4aConnection(Socks4a): self.append_write_buf(self.ipaddr) except socket.error: # Well it's not an IP number, so it's probably a DNS name. - if Proxy._remote_dns: + if self._remote_dns: # Resolve remotely rmtrslv = True self.ipaddr = None @@ -118,6 +123,7 @@ class Socks4aResolver(Socks4a): Socks4a.__init__(self, address=(self.host, self.port)) def state_auth_done(self): + """Request connection to be made""" # Now we can request the actual connection self.append_write_buf( struct.pack('>BBH', 0x04, 0xF0, self.destination[1])) diff --git a/src/network/udp.py b/src/network/udp.py index 225aabf3..33504289 100644 --- a/src/network/udp.py +++ b/src/network/udp.py @@ -124,10 +124,7 @@ class UDPSocket(BMProto): self.destination = state.Peer(*addr) encodedAddr = protocol.encodeHost(addr[0]) - if protocol.checkIPAddress(encodedAddr, True): - self.local = True - else: - self.local = False + self.local = bool(protocol.checkIPAddress(encodedAddr, True)) # overwrite the old buffer to avoid mixing data and so that # self.local works correctly self.read_buf[0:] = recdata