mirror of
https://github.com/msgpack/msgpack-python.git
synced 2026-06-19 06:02:09 +00:00
add autoreset support to Packer.pack_ext_type()
This commit is contained in:
parent
b691a8e52c
commit
1406cd49cc
1 changed files with 4 additions and 0 deletions
|
|
@ -291,6 +291,10 @@ cdef class Packer:
|
|||
raise ValueError("ext data too large")
|
||||
msgpack_pack_ext(&self.pk, typecode, len(data))
|
||||
msgpack_pack_raw_body(&self.pk, data, len(data))
|
||||
if self.autoreset:
|
||||
buf = PyBytes_FromStringAndSize(self.pk.buf, self.pk.length)
|
||||
self.pk.length = 0
|
||||
return buf
|
||||
|
||||
@cython.critical_section
|
||||
def pack_array_header(self, long long size):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue