Commit c80d8def authored by Antoine Millet's avatar Antoine Millet
Browse files

Outbound buffer is now protected with a lock.

parent 87476958
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ class RpcConnection(object):
            sent = self._sock.send(data)
            data = data[sent:]

        with self._outbound_buffer:
            if not len(self._outbound_buffer):
                self._manager.nothing_to_write(self)
    
@@ -143,6 +144,7 @@ class RpcConnection(object):
        logging.debug('Sending: %s' % message)
        json_msg = json.dumps(message)
        size = struct.pack('!L', len(json_msg))
        with self._outbound_buffer:
            self._outbound_buffer.push(size + json_msg)
            self._manager.data_to_write(self)