Skip to content

Commit

Permalink
Handle data carry over when NODATA is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
kansi committed May 1, 2018
1 parent c6c66b1 commit 86210ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions abci/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,16 @@ def __handle_connection(self, socket, address):

data.seek(0)
carry_forward = b''
if not data or msg_length == 0: return
if not data or msg_length == 0:
return
try:
while data.tell() < msg_length:
initial_data_tell = data.tell()
result, code = read_message(data, Request)
if code == NODATA: return
if code == NODATA:
data.seek(initial_data_tell)
carry_forward = data.read(msg_length - data.tell())
break
if code == FRAGDATA:
data.seek(result)
carry_forward = data.read(msg_length)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name='abci',
version='0.4.3',
version='0.4.4',
description='Python based ABCI Server for Tendermint',
long_description=long_description,
url='https://github.com/davebryson/py-abci',
Expand Down

0 comments on commit 86210ac

Please sign in to comment.