diff --git a/CHANGES/9636.feature.rst b/CHANGES/9636.feature.rst new file mode 120000 index 00000000000..a93584bccd8 --- /dev/null +++ b/CHANGES/9636.feature.rst @@ -0,0 +1 @@ +9543.feature.rst \ No newline at end of file diff --git a/aiohttp/_websocket/reader_c.pxd b/aiohttp/_websocket/reader_c.pxd index 74eb07073ec..af26d350db3 100644 --- a/aiohttp/_websocket/reader_c.pxd +++ b/aiohttp/_websocket/reader_c.pxd @@ -74,7 +74,6 @@ cdef class WebSocketReader: chunk_size="unsigned int", chunk_len="unsigned int", buf_length="unsigned int", - data=bytes, payload=bytearray, first_byte="unsigned char", second_byte="unsigned char", diff --git a/aiohttp/_websocket/reader_py.py b/aiohttp/_websocket/reader_py.py index b4b57195a96..2c77cde4c72 100644 --- a/aiohttp/_websocket/reader_py.py +++ b/aiohttp/_websocket/reader_py.py @@ -243,10 +243,9 @@ def parse_frame( if self._state == READ_HEADER: if buf_length - start_pos < 2: break - data = buf[start_pos : start_pos + 2] + first_byte = buf[start_pos] + second_byte = buf[start_pos + 1] start_pos += 2 - first_byte = data[0] - second_byte = data[1] fin = (first_byte >> 7) & 1 rsv1 = (first_byte >> 6) & 1 @@ -360,6 +359,6 @@ def parse_frame( self._frame_payload = bytearray() self._state = READ_HEADER - self._tail = buf[start_pos:] + self._tail = buf[start_pos:] if start_pos < buf_length else b"" return frames