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']: