From 8b35508b6fff683934d6118a2b62b0a146f4e92e Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Mon, 23 May 2016 17:44:01 +0800 Subject: [PATCH] show exception peer name --- shadowsocks/eventloop.py | 5 +++++ shadowsocks/tcprelay.py | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/shadowsocks/eventloop.py b/shadowsocks/eventloop.py index ce9c11b..b20ccf8 100644 --- a/shadowsocks/eventloop.py +++ b/shadowsocks/eventloop.py @@ -216,6 +216,11 @@ class EventLoop(object): handler.handle_event(sock, fd, event) except (OSError, IOError) as 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() if asap or now - self._last_time >= TIMEOUT_PRECISION: for callback in self._periodic_callbacks: diff --git a/shadowsocks/tcprelay.py b/shadowsocks/tcprelay.py index 4a456a3..0fedd80 100644 --- a/shadowsocks/tcprelay.py +++ b/shadowsocks/tcprelay.py @@ -1008,9 +1008,6 @@ class TCPRelay(object): if error_no in (errno.EAGAIN, errno.EINPROGRESS, errno.EWOULDBLOCK): return - elif error_no == errno.ECONNRESET: - shell.print_exception(e) - logging.info("recv RST, ignore") else: shell.print_exception(e) if self._config['verbose']: