Skip to content

Commit 9167b97

Browse files
author
Federico Fissore
committed
tcp.py: avoiding sending data if buff has 0 length
1 parent cccfd1a commit 9167b97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

linux/bridge/tcp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,9 @@ def run(self):
8282
for client in wr:
8383
try:
8484
buff = self.clients_sendbuffer[client]
85-
sent = client.send(buff)
86-
self.clients_sendbuffer[client] = buff[sent:]
85+
if len(buff) > 0:
86+
sent = client.send(buff)
87+
self.clients_sendbuffer[client] = buff[sent:]
8788
except:
8889
self.close(client)
8990

0 commit comments

Comments
 (0)