def inputdata(self, data):
self._log('inputdata', d=data)
- packets = slip.decode(data)
- packets[0] = self._buffer + packets[0]
+ data = self._buffer + data
+ self._buffer = b''
+ packets = slip.decode(data, True)
self._buffer = packets.pop()
for packet in packets:
self._maybe_packet(packet)
def flush(self):
self._log('flush')
- self._maybe_packet(self._buffer)
+ data = self._buffer
self._buffer = b''
+ packets = slip.decode(data)
+ assert(len(packets) == 1)
+ self._maybe_packet(packets[0])
class _IpifProcessProtocol(twisted.internet.protocol.ProcessProtocol):
def __init__(self, router):