Skip to content

Commit

Permalink
Fix merge issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
da4089 committed Jul 18, 2016
1 parent 0655bca commit 7ba29db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rnps/soupbin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def has_complete_message(buf):
# SoupBin header is 3 bytes.
return False

length = struct.unpack("!Hc", buf[:3])[0]
if len(buf) < length + 2:
soup_length, soup_type = struct.unpack("!Hc", buf[:3])
if len(buf) < soup_length + 2:
# SoupBin header length field is count of following bytes (so + 2).
return False

Expand All @@ -56,7 +56,7 @@ def get_message(buf):
if len(buf) < 3:
return None, buf

soup_length = struct.unpack("!Hc", buf[:3])[0]
soup_length, soup_type = struct.unpack("!Hc", buf[:3])
if len(buf) < soup_length + 2:
return None, buf

Expand Down

0 comments on commit 7ba29db

Please sign in to comment.