From 5923b44fe49304b860ea000871275a8a3b2564f6 Mon Sep 17 00:00:00 2001 From: Cameron Brunner Date: Fri, 15 Jan 2021 16:30:17 -0600 Subject: [PATCH] Only process valid connections The `_from_server_socket routine` may return a None which should not be sent to workers to process. for #358 --- cheroot/connections.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cheroot/connections.py b/cheroot/connections.py index 6bba727479..7debcbfd18 100644 --- a/cheroot/connections.py +++ b/cheroot/connections.py @@ -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()