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 socket
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
@ -82,7 +87,7 @@ class Socks4aConnection(Socks4a):
|
||||||
self.append_write_buf(self.ipaddr)
|
self.append_write_buf(self.ipaddr)
|
||||||
except socket.error:
|
except socket.error:
|
||||||
# Well it's not an IP number, so it's probably a DNS name.
|
# Well it's not an IP number, so it's probably a DNS name.
|
||||||
if Proxy._remote_dns:
|
if self._remote_dns:
|
||||||
# Resolve remotely
|
# Resolve remotely
|
||||||
rmtrslv = True
|
rmtrslv = True
|
||||||
self.ipaddr = None
|
self.ipaddr = None
|
||||||
|
@ -118,6 +123,7 @@ class Socks4aResolver(Socks4a):
|
||||||
Socks4a.__init__(self, address=(self.host, self.port))
|
Socks4a.__init__(self, address=(self.host, self.port))
|
||||||
|
|
||||||
def state_auth_done(self):
|
def state_auth_done(self):
|
||||||
|
"""Request connection to be made"""
|
||||||
# Now we can request the actual connection
|
# Now we can request the actual connection
|
||||||
self.append_write_buf(
|
self.append_write_buf(
|
||||||
struct.pack('>BBH', 0x04, 0xF0, self.destination[1]))
|
struct.pack('>BBH', 0x04, 0xF0, self.destination[1]))
|
||||||
|
|
|
@ -124,10 +124,7 @@ class UDPSocket(BMProto):
|
||||||
|
|
||||||
self.destination = state.Peer(*addr)
|
self.destination = state.Peer(*addr)
|
||||||
encodedAddr = protocol.encodeHost(addr[0])
|
encodedAddr = protocol.encodeHost(addr[0])
|
||||||
if protocol.checkIPAddress(encodedAddr, True):
|
self.local = bool(protocol.checkIPAddress(encodedAddr, True))
|
||||||
self.local = True
|
|
||||||
else:
|
|
||||||
self.local = False
|
|
||||||
# overwrite the old buffer to avoid mixing data and so that
|
# overwrite the old buffer to avoid mixing data and so that
|
||||||
# self.local works correctly
|
# self.local works correctly
|
||||||
self.read_buf[0:] = recdata
|
self.read_buf[0:] = recdata
|
||||||
|
|
Loading…
Reference in New Issue
Block a user