about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUltraQbik <no1skill@yandex.ru>2024-08-22 23:48:07 +0300
committerUltraQbik <no1skill@yandex.ru>2024-08-22 23:48:07 +0300
commita9db8ca9e4dc64e196fbb095939f3bfbeb659696 (patch)
tree4f9c57b0515035551fbbbd70f0cc2c53bd2c01bc
parent8143527f214f215c204bf8fa39d22f2493011f61 (diff)
downloadhttpy-a9db8ca9e4dc64e196fbb095939f3bfbeb659696.tar.gz
httpy-a9db8ca9e4dc64e196fbb095939f3bfbeb659696.zip
es
-rw-r--r--main.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/main.py b/main.py
index c4b66bc..43ebac2 100644
--- a/main.py
+++ b/main.py
@@ -137,7 +137,6 @@ class HTTPServer:
                 break
 
             # else append to client list and create new task
-            self.clients.append(client)
             await loop.create_task(self.client_handle(client))
 
     async def client_handle(self, client: ssl.SSLSocket):
@@ -280,7 +279,7 @@ class HTTPServer:
             byte_header += f"{key}: {value}\r\n".encode("ascii")
 
         # send response to the client
-        await asyncio.get_event_loop().create_task(ssl_sock_sendall(
+        await ssl_sock_sendall(
             client,
             b'HTTP/1.1 ' +
             get_response_code(response) +
@@ -288,18 +287,7 @@ class HTTPServer:
             byte_header +  # if empty, we'll just get b'\r\n\r\n'
             b'\r\n' +
             data
-        ))
-
-        # # send response to the client
-        # await ssl_sock_sendall(
-        #     client,
-        #     b'HTTP/1.1 ' +
-        #     get_response_code(response) +
-        #     b'\r\n' +
-        #     byte_header +  # if empty, we'll just get b'\r\n\r\n'
-        #     b'\r\n' +
-        #     data
-        # )
+        )
 
     def _close_client(self, client: socket.socket):
         """