Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaHOH committed Nov 18, 2022
1 parent 8d95f9a commit 9d9be56
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extproxy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
extproxy.restore_items()
"""

__version__ = "1.0.1"
__version__ = "1.0.2"
__author__ = "SeaHOH<[email protected]>"

from .extra import *
Expand Down
7 changes: 2 additions & 5 deletions extproxy/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ def socks_warning():
socks_warning()
socks = None

try:
from time import monotonic as time
except ImportError:
from time import time

if PY3:
from urllib.request import Request, ProxyHandler, proxy_bypass
try:
Expand All @@ -34,7 +29,9 @@ def socks_warning():
from urllib.request import _splittype as splittype
from urllib.parse import urlparse
from http.client import HTTPConnection
from time import perf_counter as mtime
else:
from urllib2 import Request, ProxyHandler, proxy_bypass, splittype
from urlparse import urlparse
from httplib import HTTPConnection
from time import time as mtime
6 changes: 3 additions & 3 deletions extproxy/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import errno
import threading

from .compat import PY3, time
from .compat import PY3, mtime


def _forward_socket(local, remote, wait_local=False,
Expand All @@ -23,9 +23,9 @@ def _forward_socket(local, remote, wait_local=False,
remote.sendall(buf[:ndata])

while allins and timecount > 0:
start_time = time()
start_time = mtime()
ins, _, err = select.select(allins, [], allins, tick)
t = time() - start_time
t = mtime() - start_time
timecount -= int(t)
if err:
raise socket.error(err)
Expand Down

0 comments on commit 9d9be56

Please sign in to comment.