Skip to content

Commit

Permalink
fix message decoding for chunked messages
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviogrossi committed May 13, 2014
1 parent fe23280 commit 116f851
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions txmilter/codec.py
Expand Up @@ -202,17 +202,14 @@ def decode(self):
while True: while True:
length, rest = self._decode(''.join(self._data), '!I') length, rest = self._decode(''.join(self._data), '!I')
if length is None or length == 0: if length is None or length == 0:
self._data = [rest]
break break


cmd, rest = self._decode(rest, 'c') cmd, rest = self._decode(rest, 'c')
if cmd is None: if cmd is None:
self._data = [rest]
break break


data_len = length - 1 data_len = length - 1
if len(rest) < data_len: if len(rest) < data_len:
self._data = [cmd, rest]
break break


self._data = [rest[data_len:]] self._data = [rest[data_len:]]
Expand Down

0 comments on commit 116f851

Please sign in to comment.