File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -121,20 +121,14 @@ def _make_packet_prefix(packet):
121121
122122
123123def _read_packet_length (content , content_index ):
124- while get_byte ( content , content_index ) != 0 :
124+ while content . decode ()[ content_index ] != ':' :
125125 content_index += 1
126- content_index += 1
127- packet_length_string = ''
128- byte = get_byte (content , content_index )
129- while byte != 255 :
130- packet_length_string += str (byte )
131- content_index += 1
132- byte = get_byte (content , content_index )
126+ packet_length_string = content .decode ()[0 :content_index ]
133127 return content_index , int (packet_length_string )
134128
135129
136130def _read_packet_text (content , content_index , packet_length ):
137- while get_byte ( content , content_index ) == 255 :
131+ while content . decode ()[ content_index ] == ':' :
138132 content_index += 1
139133 packet_text = content [content_index :content_index + packet_length ]
140134 return content_index + packet_length , packet_text
You can’t perform that action at this time.
0 commit comments