Browse Source

[trac420] Fix a bug when the write did not fit

Pointed out in review.
A test that would catch it needs to be written.
Michal 'vorner' Vaner 14 years ago
parent
commit
51d35705f4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/bin/msgq/msgq.py.in

+ 2 - 2
src/bin/msgq/msgq.py.in

@@ -345,9 +345,9 @@ class MsgQ:
                 if now - last_sent > 0.1:
                 if now - last_sent > 0.1:
                     self.kill_socket(fileno, sock)
                     self.kill_socket(fileno, sock)
                     return
                     return
-                buff += msg[amount_sent:]
+                buff += msg
             else:
             else:
-                buff = msg
+                buff = msg[amount_sent:]
                 last_sent = now
                 last_sent = now
                 if self.poller:
                 if self.poller:
                     self.poller.register(fileno, select.POLLIN |
                     self.poller.register(fileno, select.POLLIN |