@@ -8,12 +8,17 @@ cdef unsigned int READ_PAYLOAD_LENGTH
8
8
cdef unsigned int READ_PAYLOAD_MASK
9
9
cdef unsigned int READ_PAYLOAD
10
10
11
- cdef unsigned int OP_CODE_CONTINUATION
12
- cdef unsigned int OP_CODE_TEXT
13
- cdef unsigned int OP_CODE_BINARY
14
- cdef unsigned int OP_CODE_CLOSE
15
- cdef unsigned int OP_CODE_PING
16
- cdef unsigned int OP_CODE_PONG
11
+ cdef int OP_CODE_NOT_SET
12
+ cdef int OP_CODE_CONTINUATION
13
+ cdef int OP_CODE_TEXT
14
+ cdef int OP_CODE_BINARY
15
+ cdef int OP_CODE_CLOSE
16
+ cdef int OP_CODE_PING
17
+ cdef int OP_CODE_PONG
18
+
19
+ cdef int COMPRESSED_NOT_SET
20
+ cdef int COMPRESSED_FALSE
21
+ cdef int COMPRESSED_TRUE
17
22
18
23
cdef object UNPACK_LEN3
19
24
cdef object UNPACK_CLOSE_CODE
@@ -60,9 +65,9 @@ cdef class WebSocketReader:
60
65
cdef bytearray _partial
61
66
cdef unsigned int _state
62
67
63
- cdef object _opcode
64
- cdef object _frame_fin
65
- cdef object _frame_opcode
68
+ cdef int _opcode
69
+ cdef bint _frame_fin
70
+ cdef int _frame_opcode
66
71
cdef object _frame_payload
67
72
cdef unsigned long long _frame_payload_len
68
73
@@ -71,7 +76,7 @@ cdef class WebSocketReader:
71
76
cdef bytes _frame_mask
72
77
cdef unsigned long long _payload_length
73
78
cdef unsigned int _payload_length_flag
74
- cdef object _compressed
79
+ cdef int _compressed
75
80
cdef object _decompressobj
76
81
cdef bint _compress
77
82
@@ -82,22 +87,21 @@ cdef class WebSocketReader:
82
87
fin = bint,
83
88
has_partial = bint,
84
89
payload_merged = bytes,
85
- opcode = " unsigned int" ,
86
90
)
87
- cpdef void _feed_data (self , bytes data)
91
+ cpdef void _handle_frame (self , bint fin, int opcode, object payload, int compressed) except *
88
92
89
93
@ cython.locals (
90
94
start_pos = " unsigned int" ,
91
- buf_len = " unsigned int" ,
95
+ data_len = " unsigned int" ,
92
96
length = " unsigned int" ,
93
97
chunk_size = " unsigned int" ,
94
98
chunk_len = " unsigned int" ,
95
- buf_length = " unsigned int" ,
96
- buf_cstr = " const unsigned char *" ,
99
+ data_length = " unsigned int" ,
100
+ data_cstr = " const unsigned char *" ,
97
101
first_byte = " unsigned char" ,
98
102
second_byte = " unsigned char" ,
99
103
end_pos = " unsigned int" ,
100
104
has_mask = bint,
101
105
fin = bint,
102
106
)
103
- cpdef list parse_frame (self , bytes buf)
107
+ cpdef void _feed_data (self , bytes data) except *
0 commit comments