diff options
| author | UltraQbik <no1skill@yandex.ru> | 2024-08-29 13:10:01 +0300 |
|---|---|---|
| committer | UltraQbik <no1skill@yandex.ru> | 2024-08-29 13:10:01 +0300 |
| commit | 9d618baeafd73ef4ea1d6a2ec90d87f63bb8908c (patch) | |
| tree | 0d01e330e5d97e2d9584155cfa998fbc18067ad8 | |
| parent | 8173c19f6fd5109fd7878091f414eb1b13d07c9e (diff) | |
| download | httpy-9d618baeafd73ef4ea1d6a2ec90d87f63bb8908c.tar.gz httpy-9d618baeafd73ef4ea1d6a2ec90d87f63bb8908c.zip | |
Update things
| -rw-r--r-- | main.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/main.py b/main.py index 2bd9c9d..60bb023 100644 --- a/main.py +++ b/main.py @@ -166,6 +166,12 @@ class HTTPServer: client.setblocking(False) request = self._recv_request(client) if request is not None: + # log request + logging.info(f"IP: {client.getpeername()[0]}") + for key, val in request.__dict__.items(): + logging.info(f"{key}: {val}") + + # handle request self._client_request_handler(client, request) except Exception as e: logging.warning("ignoring error:", exc_info=e) @@ -280,7 +286,6 @@ class HTTPServer: return time.sleep(SOCKET_ACK_INTERVAL) timer -= 1 - print(timer) if self.stop_event.is_set() or timer <= 0: return |