Apply PIE to nghttpx
[platform/upstream/nghttp2.git] / doc / nghttp2_hd_deflate_hd.rst
1
2 nghttp2_hd_deflate_hd
3 =====================
4
5 Synopsis
6 --------
7
8 *#include <nghttp2/nghttp2.h>*
9
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)
11
12     
13     Deflates the *nva*, which has the *nvlen* name/value pairs, into
14     the *buf* of length *buflen*.
15     
16     If *buf* is not large enough to store the deflated header block,
17     this function fails with :macro:`NGHTTP2_ERR_INSUFF_BUFSIZE`.  The
18     caller should use `nghttp2_hd_deflate_bound()` to know the upper
19     bound of buffer size required to deflate given header name/value
20     pairs.
21     
22     Once this function fails, subsequent call of this function always
23     returns :macro:`NGHTTP2_ERR_HEADER_COMP`.
24     
25     After this function returns, it is safe to delete the *nva*.
26     
27     This function returns the number of bytes written to *buf* if it
28     succeeds, or one of the following negative error codes:
29     
30     :macro:`NGHTTP2_ERR_NOMEM`
31         Out of memory.
32     :macro:`NGHTTP2_ERR_HEADER_COMP`
33         Deflation process has failed.
34     :macro:`NGHTTP2_ERR_INSUFF_BUFSIZE`
35         The provided *buflen* size is too small to hold the output.