Skip to content

Commit ab27deb

Browse files
committed
http/bench: Handle keep-alive properly
1 parent eed279e commit ab27deb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

servers/asyncio_http_server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ def handle(self, request, response):
108108
resp = b'X' * payload_size
109109
_RESP_CACHE[payload_size] = resp
110110
response.write(resp)
111+
if not self._current_parser.should_keep_alive():
112+
self._transport.close()
111113
self._current_parser = None
112114
self._current_request = None
113115

0 commit comments

Comments
 (0)