Browse Source

show exception peer name

dev
BreakWa11 9 years ago
parent
commit
8b35508b6f
  1. 5
      shadowsocks/eventloop.py
  2. 3
      shadowsocks/tcprelay.py

5
shadowsocks/eventloop.py

@ -216,6 +216,11 @@ class EventLoop(object):
handler.handle_event(sock, fd, event) handler.handle_event(sock, fd, event)
except (OSError, IOError) as e: except (OSError, IOError) as e:
shell.print_exception(e) shell.print_exception(e)
try:
addr = sock.getpeername()[:2]
logging.error('exception peer name %s:%d' % (addr[0], addr[1]))
except:
pass
now = time.time() now = time.time()
if asap or now - self._last_time >= TIMEOUT_PRECISION: if asap or now - self._last_time >= TIMEOUT_PRECISION:
for callback in self._periodic_callbacks: for callback in self._periodic_callbacks:

3
shadowsocks/tcprelay.py

@ -1008,9 +1008,6 @@ class TCPRelay(object):
if error_no in (errno.EAGAIN, errno.EINPROGRESS, if error_no in (errno.EAGAIN, errno.EINPROGRESS,
errno.EWOULDBLOCK): errno.EWOULDBLOCK):
return return
elif error_no == errno.ECONNRESET:
shell.print_exception(e)
logging.info("recv RST, ignore")
else: else:
shell.print_exception(e) shell.print_exception(e)
if self._config['verbose']: if self._config['verbose']:

Loading…
Cancel
Save