about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--main.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.py b/main.py
index 4edd2ba..46740e9 100644
--- a/main.py
+++ b/main.py
@@ -107,6 +107,7 @@ class HTTPServer:
         :param client: client ssl socket
         """
 
+        client.settimeout(5)
         while not self.stop_event.is_set():
             try:
                 # get client's request
@@ -115,6 +116,9 @@ class HTTPServer:
                     break
 
                 print(request, end="\n\n")
+            except TimeoutError:
+                print("Client timeout")
+                break
             except OSError as e:
                 print(e)
                 break