Skip to content

Commit

Permalink
remove unnecessary overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
clowwindy committed Aug 2, 2015
1 parent 999a541 commit 4211184
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions shadowsocks/eventloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,8 @@ def add_periodic(self, callback):
def remove_periodic(self, callback):
self._periodic_callbacks.remove(callback)

def modify(self, f, mode, handler):
def modify(self, f, mode):
fd = f.fileno()
self._fdmap[fd] = (f, handler)
self._impl.modify(fd, mode)

def stop(self):
Expand Down
4 changes: 2 additions & 2 deletions shadowsocks/tcprelay.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,14 @@ def _update_stream(self, stream, status):
event |= eventloop.POLL_OUT
if self._upstream_status & WAIT_STATUS_READING:
event |= eventloop.POLL_IN
self._loop.modify(self._local_sock, event, self._server)
self._loop.modify(self._local_sock, event)
if self._remote_sock:
event = eventloop.POLL_ERR
if self._downstream_status & WAIT_STATUS_READING:
event |= eventloop.POLL_IN
if self._upstream_status & WAIT_STATUS_WRITING:
event |= eventloop.POLL_OUT
self._loop.modify(self._remote_sock, event, self._server)
self._loop.modify(self._remote_sock, event)

def _write_to_sock(self, data, sock):
# write data to sock
Expand Down

0 comments on commit 4211184

Please sign in to comment.