Browse Source

fix POLL_HUP

auth
clowwindy 11 years ago
parent
commit
35bfa56eaf
  1. 4
      shadowsocks/tcprelay.py

4
shadowsocks/tcprelay.py

@ -433,7 +433,7 @@ class TCPRelayHandler(object):
self._on_remote_error() self._on_remote_error()
if self._stage == STAGE_DESTROYED: if self._stage == STAGE_DESTROYED:
return return
if event & eventloop.POLL_IN: if event & (eventloop.POLL_IN | eventloop.POLL_HUP):
self._on_remote_read() self._on_remote_read()
if self._stage == STAGE_DESTROYED: if self._stage == STAGE_DESTROYED:
return return
@ -444,7 +444,7 @@ class TCPRelayHandler(object):
self._on_local_error() self._on_local_error()
if self._stage == STAGE_DESTROYED: if self._stage == STAGE_DESTROYED:
return return
if event & eventloop.POLL_IN: if event & (eventloop.POLL_IN | eventloop.POLL_HUP):
self._on_local_read() self._on_local_read()
if self._stage == STAGE_DESTROYED: if self._stage == STAGE_DESTROYED:
return return

Loading…
Cancel
Save