File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,18 @@ cdef class ReadBuffer:
91
91
ssize_t _current_message_len_unread
92
92
bint _current_message_ready
93
93
94
+ cdef inline len (self ):
95
+ return self ._length
96
+
97
+ cdef inline char get_message_type(self ):
98
+ return self ._current_message_type
99
+
100
+ cdef inline int32_t get_message_length(self ):
101
+ return self ._current_message_len
102
+
103
+ cdef inline read_utf8(self ):
104
+ return self .read_cstr().decode(' utf-8' )
105
+
94
106
cdef feed_data(self , data)
95
107
cdef inline _ensure_first_buf(self )
96
108
cdef _switch_to_next_buf(self )
@@ -113,11 +125,5 @@ cdef class ReadBuffer:
113
125
cdef finish_message(self )
114
126
cdef inline _finish_message(self )
115
127
116
- cdef inline char get_message_type(self ):
117
- return self ._current_message_type
118
-
119
- cdef inline int32_t get_message_length(self ):
120
- return self ._current_message_len
121
-
122
128
@staticmethod
123
129
cdef ReadBuffer new_message_parser(object data)
Original file line number Diff line number Diff line change @@ -590,7 +590,7 @@ cdef class ReadBuffer:
590
590
else :
591
591
buf.write_bytes(self .consume_message())
592
592
593
- if not self .has_message() or self ._current_message_type ! = mtype:
593
+ if not self .take_message_type( mtype) :
594
594
break
595
595
596
596
return buf
You can’t perform that action at this time.
0 commit comments