nghttp2_hpack_encoder_write
Synopsis
#include <nghttp2v2/nghttp2.h>
-
int nghttp2_hpack_encoder_write(nghttp2_hpack_encoder *enc, nghttp2_buf *buf, const nghttp2_nv *nva, size_t nvlen)
nghttp2_hpack_encoder_write()encodes the nva of nvlen elements into buf.This function expands buf as necessary to store the result.
buf->lastwill be adjusted when data is written. buf can be empty buffer, that is initialized bynghttp2_buf_init(). Ifbuf->beginis notNULL, it must be allocated by the same memory allocator passed tonghttp2_hpack_encoder_new().After this function returns, it is safe to delete the nva.
This function returns 0 if it succeeds, or one of the following negative error codes:
NGHTTP2_ERR_NOMEMOut of memory.
NGHTTP2_ERR_HPACK_FATALEncoding process has failed.