From 26709f4086c0351e98616f17ba56e5747cda48af Mon Sep 17 00:00:00 2001 From: Mike Piecuch <101891586+mikesway@users.noreply.github.com> Date: Tue, 26 Dec 2023 12:23:08 -0500 Subject: [PATCH] Fix Response.send_chunk() and helpers.sendfile() (#150) --- src/socketify/socketify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/socketify/socketify.py b/src/socketify/socketify.py index 7cc0217..2c74e1c 100644 --- a/src/socketify/socketify.py +++ b/src/socketify/socketify.py @@ -1623,13 +1623,14 @@ class AppResponse: ) # if aborted set to done True and ok False return self._chunkFuture + self._lastChunkOffset = self.get_write_offset() + (ok, done) = self.try_end(buffer, total_size) if ok: self._chunkFuture.set_result((ok, done)) return self._chunkFuture - # failed to send chunk - self._lastChunkOffset = self.get_write_offset() + # failed to send chunk return self._chunkFuture def get_data(self):