Skip to content

Commit 6121fe9

Browse files
authored
must_flush_before_shutdown until entire client buffer has been flushed (#686)
1 parent 25b7952 commit 6121fe9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

proxy/core/base/tcp_server.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ def handle_writables(self, writables: Writables) -> bool:
9292
)
9393
self.client.flush()
9494
if self.must_flush_before_shutdown is True:
95-
teardown = True
96-
self.must_flush_before_shutdown = False
95+
if not self.client.has_buffer():
96+
teardown = True
97+
self.must_flush_before_shutdown = False
9798
return teardown
9899

99100
def handle_readables(self, readables: Readables) -> bool:

0 commit comments

Comments
 (0)