socks4a pylint fixes
This commit is contained in:
parent
8f848609ef
commit
79d1b1b9e2
|
@ -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]))
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in New Issue
Block a user