From f639128bd7673195993e6156edc288d7a11f64fa Mon Sep 17 00:00:00 2001 From: Vytautas Liuolia Date: Fri, 12 Nov 2021 21:39:10 +0100 Subject: [PATCH] Fix sendfile behaviour for open files with non-zero offset. --- gunicorn/http/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gunicorn/http/wsgi.py b/gunicorn/http/wsgi.py index 478677f4..f14e6794 100644 --- a/gunicorn/http/wsgi.py +++ b/gunicorn/http/wsgi.py @@ -372,7 +372,7 @@ class Response(object): chunk_size = "%X\r\n" % nbytes self.sock.sendall(chunk_size.encode('utf-8')) - self.sock.sendfile(respiter.filelike, count=nbytes) + self.sock.sendfile(respiter.filelike, offset=offset, count=nbytes) if self.is_chunked(): self.sock.sendall(b"\r\n")