Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Detect error conditions after reading from sockets

This change is in the hypercoordinator main loop.
  • Loading branch information...
commit 504189104b6c4e4a98c689e41a45c159279b8030 1 parent cf8fe7a
Robert Escriva authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 hypercoordinator/coordinator.py
12 hypercoordinator/coordinator.py
View
@@ -758,18 +758,18 @@ def run(self):
sock, conn = self._conns[fd]
remove = False
try:
+ if ev & select.POLLIN:
+ conn.handle_in()
+ if ev & select.POLLOUT:
+ conn.handle_out()
+ if conn.outgoing == '':
+ self._p.modify(fd, select.POLLIN)
if ev & select.POLLERR:
remove = True
elif ev & select.POLLHUP:
remove = True
elif ev & select.POLLNVAL:
remove = True
- if not remove and ev & select.POLLIN:
- conn.handle_in()
- if not remove and ev & select.POLLOUT:
- conn.handle_out()
- if conn.outgoing == '':
- self._p.modify(fd, select.POLLIN)
except KillConnection as kc:
logging.error('connection killed: ' + str(kc))
remove = True
Please sign in to comment.
Something went wrong with that request. Please try again.