Browse Source

use absolute import

auth
clowwindy 10 years ago
parent
commit
0814888ba5
  1. 7
      shadowsocks/asyncdns.py
  2. 14
      shadowsocks/encrypt.py
  3. 8
      shadowsocks/local.py
  4. 8
      shadowsocks/server.py
  5. 7
      shadowsocks/tcprelay.py
  6. 7
      shadowsocks/udprelay.py

7
shadowsocks/asyncdns.py

@ -27,14 +27,13 @@ import socket
import struct import struct
import re import re
import logging import logging
import common
import lru_cache from shadowsocks import common, lru_cache, eventloop
import eventloop
CACHE_SWEEP_INTERVAL = 30 CACHE_SWEEP_INTERVAL = 30
VALID_HOSTNAME = re.compile("(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE) VALID_HOSTNAME = re.compile(r"(?!-)[A-Z\d-]{1,63}(?<!-)$", re.IGNORECASE)
common.patch_socket() common.patch_socket()

14
shadowsocks/encrypt.py

@ -26,19 +26,17 @@ import hashlib
import string import string
import struct import struct
import logging import logging
import crypto.m2
import crypto.rc4_md5 from shadowsocks.crypto import m2, rc4_md5, salsa20_ctr, ctypes_openssl
import crypto.salsa20_ctr
import crypto.ctypes_openssl
method_supported = {} method_supported = {}
method_supported.update(crypto.rc4_md5.ciphers) method_supported.update(rc4_md5.ciphers)
method_supported.update(crypto.salsa20_ctr.ciphers) method_supported.update(salsa20_ctr.ciphers)
method_supported.update(crypto.ctypes_openssl.ciphers) method_supported.update(ctypes_openssl.ciphers)
# let M2Crypto override ctypes_openssl # let M2Crypto override ctypes_openssl
method_supported.update(crypto.m2.ciphers) method_supported.update(m2.ciphers)
def random_string(length): def random_string(length):

8
shadowsocks/local.py

@ -25,12 +25,8 @@ import sys
import os import os
import logging import logging
import signal import signal
import utils
import encrypt from shadowsocks import utils, encrypt, eventloop, tcprelay, udprelay, asyncdns
import eventloop
import tcprelay
import udprelay
import asyncdns
def main(): def main():

8
shadowsocks/server.py

@ -25,12 +25,8 @@ import sys
import os import os
import logging import logging
import signal import signal
import utils
import encrypt from shadowsocks import utils, encrypt, eventloop, tcprelay, udprelay, asyncdns
import eventloop
import tcprelay
import udprelay
import asyncdns
def main(): def main():

7
shadowsocks/tcprelay.py

@ -28,10 +28,9 @@ import struct
import logging import logging
import traceback import traceback
import random import random
import encrypt
import eventloop from shadowsocks import encrypt, eventloop, utils
import utils from shadowsocks.common import parse_header
from common import parse_header
TIMEOUTS_CLEAN_SIZE = 512 TIMEOUTS_CLEAN_SIZE = 512

7
shadowsocks/udprelay.py

@ -72,10 +72,9 @@ import logging
import struct import struct
import errno import errno
import random import random
import encrypt
import eventloop from shadowsocks import encrypt, eventloop, lru_cache
import lru_cache from shadowsocks.common import parse_header, pack_addr
from common import parse_header, pack_addr
BUF_SIZE = 65536 BUF_SIZE = 65536

Loading…
Cancel
Save