mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 10:38:53 +08:00
Add nghttp2_hd_inflate_hd2() and deprecate nghttp2_hd_inflate_hd()
The difference between them are former has const qualifier to the |in| parameter, which is desirable since it is effectively read-only.
This commit is contained in:
@@ -314,9 +314,10 @@ cdef extern from 'nghttp2/nghttp2.h':
|
||||
int nghttp2_hd_inflate_change_table_size(nghttp2_hd_inflater *inflater,
|
||||
size_t hd_table_bufsize_max)
|
||||
|
||||
ssize_t nghttp2_hd_inflate_hd(nghttp2_hd_inflater *inflater,
|
||||
nghttp2_nv *nv_out, int *inflate_flags,
|
||||
uint8_t *input, size_t inlen, int in_final)
|
||||
ssize_t nghttp2_hd_inflate_hd2(nghttp2_hd_inflater *inflater,
|
||||
nghttp2_nv *nv_out, int *inflate_flags,
|
||||
const uint8_t *input, size_t inlen,
|
||||
int in_final)
|
||||
|
||||
int nghttp2_hd_inflate_end_headers(nghttp2_hd_inflater *inflater)
|
||||
|
||||
|
||||
@@ -191,9 +191,9 @@ cdef class HDInflater:
|
||||
res = []
|
||||
while True:
|
||||
inflate_flags = 0
|
||||
rv = cnghttp2.nghttp2_hd_inflate_hd(self._inflater, &nv,
|
||||
&inflate_flags,
|
||||
buf, buflen, 1)
|
||||
rv = cnghttp2.nghttp2_hd_inflate_hd2(self._inflater, &nv,
|
||||
&inflate_flags,
|
||||
buf, buflen, 1)
|
||||
if rv < 0:
|
||||
raise Exception(_strerror(rv))
|
||||
buf += rv
|
||||
|
||||
Reference in New Issue
Block a user