diff --git a/shadowsocks/asyncdns.py b/shadowsocks/asyncdns.py index f745be7..3cf1625 100644 --- a/shadowsocks/asyncdns.py +++ b/shadowsocks/asyncdns.py @@ -403,8 +403,8 @@ class DNSResolver(object): self._request_id = 1 req = build_request(hostname, qtype, self._request_id) for server in self._servers: - logging.debug('resolving %s with type %d using server %s', hostname, - qtype, server) + logging.debug('resolving %s with type %d using server %s', + hostname, qtype, server) self._sock.sendto(req, (server, 53)) def resolve(self, hostname, callback): diff --git a/shadowsocks/common.py b/shadowsocks/common.py index 7548ff3..6307ea7 100644 --- a/shadowsocks/common.py +++ b/shadowsocks/common.py @@ -126,7 +126,8 @@ def parse_header(data): else: logging.warn('header is too short') else: - logging.warn('unsupported addrtype %d, maybe wrong password' % addrtype) + logging.warn('unsupported addrtype %d, maybe wrong password' % + addrtype) if dest_addr is None: return None return addrtype, dest_addr, dest_port, header_length diff --git a/shadowsocks/encrypt.py b/shadowsocks/encrypt.py index 86c5d6d..952fd72 100644 --- a/shadowsocks/encrypt.py +++ b/shadowsocks/encrypt.py @@ -154,7 +154,8 @@ class Encryptor(object): iv = iv_ iv = iv[:m[1]] if op == 1: - self.cipher_iv = iv[:m[1]] # this iv is for cipher not decipher + # this iv is for cipher not decipher + self.cipher_iv = iv[:m[1]] if method != 'salsa20-ctr': import M2Crypto.EVP return M2Crypto.EVP.Cipher(method.replace('-', '_'), key, iv, diff --git a/shadowsocks/encrypt_salsa20.py b/shadowsocks/encrypt_salsa20.py index 62bca65..823ae65 100644 --- a/shadowsocks/encrypt_salsa20.py +++ b/shadowsocks/encrypt_salsa20.py @@ -67,7 +67,8 @@ class Salsa20Cipher(object): def _next_stream(self): self._nonce &= 0xFFFFFFFFFFFFFFFF self._stream = salsa20.Salsa20_keystream(BLOCK_SIZE, - struct.pack('