From 5e4db9dac380a6afeacd99a33e42528e5785d201 Mon Sep 17 00:00:00 2001 From: retoor Date: Wed, 18 Dec 2024 04:15:57 +0100 Subject: [PATCH] Good working max performance settings. 500 concurrency easy. Silent. --- src/zamenyat/app.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/zamenyat/app.py b/src/zamenyat/app.py index e8222ce..d763094 100644 --- a/src/zamenyat/app.py +++ b/src/zamenyat/app.py @@ -76,7 +76,7 @@ class AsyncReader: class Socket: - def __init__(self, reader, writer, buffer_size,debug=True): + def __init__(self, reader, writer, buffer_size,debug=False): self.debug = debug self.reader = AsyncReader(reader,debug=self.debug) self.writer = AsyncWriter(writer,debug=self.debug) @@ -141,12 +141,10 @@ class Application: if 'Content-Length' in headers: while len(data) != headers['Content-Length']: chunk_size = headers['Content-Length'] - len(data) if self.buffer_size > headers['Content-Length'] - len(data) else self.buffer_size - print("Bef read") chunk = await reader.read(chunk_size) if not chunk: data = None return None - print("Aff read") data += chunk await writer.write(self.header_dict_to_bytes(req_resp, headers)) await writer.drain() @@ -155,8 +153,6 @@ class Application: else: data = await reader.read() await writer.write(data) - #if not headers.get('Connection') == 'keep-alive': # and not headers.get('Upgrade-Insecure-Requests'): - # break if not is_websocket: break except asyncio.CancelledError: