remove unnecessary overwrite
This commit is contained in:
parent
999a54168e
commit
4211184886
2 changed files with 3 additions and 4 deletions
|
@ -176,9 +176,8 @@ class EventLoop(object):
|
||||||
def remove_periodic(self, callback):
|
def remove_periodic(self, callback):
|
||||||
self._periodic_callbacks.remove(callback)
|
self._periodic_callbacks.remove(callback)
|
||||||
|
|
||||||
def modify(self, f, mode, handler):
|
def modify(self, f, mode):
|
||||||
fd = f.fileno()
|
fd = f.fileno()
|
||||||
self._fdmap[fd] = (f, handler)
|
|
||||||
self._impl.modify(fd, mode)
|
self._impl.modify(fd, mode)
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
|
|
|
@ -173,14 +173,14 @@ class TCPRelayHandler(object):
|
||||||
event |= eventloop.POLL_OUT
|
event |= eventloop.POLL_OUT
|
||||||
if self._upstream_status & WAIT_STATUS_READING:
|
if self._upstream_status & WAIT_STATUS_READING:
|
||||||
event |= eventloop.POLL_IN
|
event |= eventloop.POLL_IN
|
||||||
self._loop.modify(self._local_sock, event, self._server)
|
self._loop.modify(self._local_sock, event)
|
||||||
if self._remote_sock:
|
if self._remote_sock:
|
||||||
event = eventloop.POLL_ERR
|
event = eventloop.POLL_ERR
|
||||||
if self._downstream_status & WAIT_STATUS_READING:
|
if self._downstream_status & WAIT_STATUS_READING:
|
||||||
event |= eventloop.POLL_IN
|
event |= eventloop.POLL_IN
|
||||||
if self._upstream_status & WAIT_STATUS_WRITING:
|
if self._upstream_status & WAIT_STATUS_WRITING:
|
||||||
event |= eventloop.POLL_OUT
|
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):
|
def _write_to_sock(self, data, sock):
|
||||||
# write data to sock
|
# write data to sock
|
||||||
|
|
Loading…
Reference in a new issue