File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -120,21 +120,19 @@ def _make_packet_prefix(packet):
120120 return header_digits
121121
122122
123- def _read_packet_length (content , content_index ):
124- while get_byte (content , content_index ) != 0 :
125- content_index += 1
126- content_index += 1
123+ def _read_packet_length (content ):
127124 packet_length_string = ''
128125 byte = get_byte (content , content_index )
129- while byte != 255 :
130- packet_length_string += str (byte )
126+ while byte != 58 : # ':'
127+ packet_length_string += chr (byte )
131128 content_index += 1
132129 byte = get_byte (content , content_index )
130+ content_index += 1
133131 return content_index , int (packet_length_string )
134132
135133
136134def _read_packet_text (content , content_index , packet_length ):
137- while get_byte (content , content_index ) == 255 :
135+ while get_byte (content , content_index ) == '0' :
138136 content_index += 1
139137 packet_text = content [content_index :content_index + packet_length ]
140138 return content_index + packet_length , packet_text
You can’t perform that action at this time.
0 commit comments