8 *#include <nghttp2/nghttp2.h>*
10 .. function:: ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf, size_t buflen, const nghttp2_nv *nva, size_t nvlen)
13 Deflates the *nva*, which has the *nvlen* name/value pairs, into
14 the *buf* of length *buflen*.
16 If *buf* is not large enough to store the deflated header block,
17 this function fails with
18 :macro:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`. The caller
19 should use `nghttp2_hd_deflate_bound()` to know the upper bound of
20 buffer size required to deflate given header name/value pairs.
22 Once this function fails, subsequent call of this function always
23 returns :macro:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`.
25 After this function returns, it is safe to delete the *nva*.
27 This function returns the number of bytes written to *buf* if it
28 succeeds, or one of the following negative error codes:
30 :macro:`nghttp2_error.NGHTTP2_ERR_NOMEM`
32 :macro:`nghttp2_error.NGHTTP2_ERR_HEADER_COMP`
33 Deflation process has failed.
34 :macro:`nghttp2_error.NGHTTP2_ERR_INSUFF_BUFSIZE`
35 The provided *buflen* size is too small to hold the output.