From a149ca5810b4834893fd74b671bf10f45c3c8db9 Mon Sep 17 00:00:00 2001 From: czasg <972542655@qq.com> Date: Tue, 16 Jan 2024 15:00:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20sendall=E6=94=B9=E7=94=A8sendfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pywss/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pywss/__init__.py b/pywss/__init__.py index db574e8..5a40b89 100644 --- a/pywss/__init__.py +++ b/pywss/__init__.py @@ -338,10 +338,7 @@ def __flush_body(self): elif isinstance(body, str): self.fd.sendall(body.encode()) elif isinstance(body, BufferedReader): - chunk = body.read(8192) - while chunk: - self.fd.sendall(chunk) - chunk = body.read(8192) + self.fd.sendfile(body) body.close() def __str__(self):