[][src]Function libnghttp2_sys::nghttp2_hd_deflate_hd

pub unsafe extern "C" fn nghttp2_hd_deflate_hd(
    deflater: *mut nghttp2_hd_deflater,
    buf: *mut u8,
    buflen: usize,
    nva: *const nghttp2_nv,
    nvlen: usize
) -> isize

@function

Deflates the |nva|, which has the |nvlen| name/value pairs, into the |buf| of length |buflen|.

If |buf| is not large enough to store the deflated header block, this function fails with :enum:NGHTTP2_ERR_INSUFF_BUFSIZE. The caller should use nghttp2_hd_deflate_bound() to know the upper bound of buffer size required to deflate given header name/value pairs.

Once this function fails, subsequent call of this function always returns :enum:NGHTTP2_ERR_HEADER_COMP.

After this function returns, it is safe to delete the |nva|.

This function returns the number of bytes written to |buf| if it succeeds, or one of the following negative error codes:

:enum:NGHTTP2_ERR_NOMEM Out of memory. :enum:NGHTTP2_ERR_HEADER_COMP Deflation process has failed. :enum:NGHTTP2_ERR_INSUFF_BUFSIZE The provided |buflen| size is too small to hold the output.