Commit 4cc55e3 1 parent e503f7a commit 4cc55e3 Copy full SHA for 4cc55e3
File tree 3 files changed +4
-5
lines changed
3 files changed +4
-5
lines changed Original file line number Diff line number Diff line change
1
+ 9543.feature.rst
Original file line number Diff line number Diff line change @@ -74,7 +74,6 @@ cdef class WebSocketReader:
74
74
chunk_size = " unsigned int" ,
75
75
chunk_len = " unsigned int" ,
76
76
buf_length = " unsigned int" ,
77
- data = bytes,
78
77
payload = bytearray,
79
78
first_byte = " unsigned char" ,
80
79
second_byte = " unsigned char" ,
Original file line number Diff line number Diff line change @@ -243,10 +243,9 @@ def parse_frame(
243
243
if self ._state == READ_HEADER :
244
244
if buf_length - start_pos < 2 :
245
245
break
246
- data = buf [start_pos : start_pos + 2 ]
246
+ first_byte = buf [start_pos ]
247
+ second_byte = buf [start_pos + 1 ]
247
248
start_pos += 2
248
- first_byte = data [0 ]
249
- second_byte = data [1 ]
250
249
251
250
fin = (first_byte >> 7 ) & 1
252
251
rsv1 = (first_byte >> 6 ) & 1
@@ -360,6 +359,6 @@ def parse_frame(
360
359
self ._frame_payload = bytearray ()
361
360
self ._state = READ_HEADER
362
361
363
- self ._tail = buf [start_pos :]
362
+ self ._tail = buf [start_pos :] if start_pos < buf_length else b""
364
363
365
364
return frames
You can’t perform that action at this time.
0 commit comments