forked from invisibleroads/socketIO-client
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added PR invisibleroads#158 by oguzhanogreden
- Loading branch information
Showing
1 changed file
with
3 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -121,20 +121,14 @@ def _make_packet_prefix(packet): | |
|
||
|
||
def _read_packet_length(content, content_index): | ||
while get_byte(content, content_index) != 0: | ||
while content.decode()[content_index] != ':': | ||
content_index += 1 | ||
content_index += 1 | ||
packet_length_string = '' | ||
byte = get_byte(content, content_index) | ||
while byte != 255: | ||
packet_length_string += str(byte) | ||
content_index += 1 | ||
byte = get_byte(content, content_index) | ||
packet_length_string = content.decode()[0:content_index] | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Nakroma
Author
Member
|
||
return content_index, int(packet_length_string) | ||
|
||
|
||
def _read_packet_text(content, content_index, packet_length): | ||
while get_byte(content, content_index) == 255: | ||
while content.decode()[content_index] == ':': | ||
content_index += 1 | ||
packet_text = content[content_index:content_index + packet_length] | ||
return content_index + packet_length, packet_text |
I think there should be
content.decode()[<2nd function argument>:content_index]
, not justcontent.decode()[0:content_index]
, because I'm periodically getting errors likeand applying this patch seems to fix that.