Skip to content

Commit

Permalink
Only process valid connections
Browse files Browse the repository at this point in the history
The `_from_server_socket routine` may return a None which should
not be sent to workers to process.

for #358
  • Loading branch information
cameronbrunner committed Jan 15, 2021
1 parent 0ebe8ee commit 6325dd5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cheroot/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ def _run(self, expiration_interval):
if conn is self.server:
# New connection
new_conn = self._from_server_socket(self.server.socket)
self.server.process_conn(new_conn)
if new_conn is not None:
self.server.process_conn(new_conn)
else:
# unregister connection from the selector until the server
# has read from it and returned it via put()
Expand Down

0 comments on commit 6325dd5

Please sign in to comment.