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:
Tatsuhiro Tsujikawa
2016-05-14 18:25:20 +09:00
parent 796160cb77
commit 2a96d433ec
8 changed files with 125 additions and 29 deletions

View File

@@ -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)

View File

@@ -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