Lines Matching refs:datalen
164 static int hpack_integer_decode(const uint8_t *buf, size_t datalen, in hpack_integer_decode() argument
173 if (datalen == 0) { in hpack_integer_decode()
188 if (--datalen == 0) { in hpack_integer_decode()
214 uint8_t *buf = header->buf + header->datalen; in hpack_huffman_decode()
215 size_t buflen = sizeof(header->buf) - header->datalen; in hpack_huffman_decode()
233 header->datalen += ret; in hpack_huffman_decode()
238 static int hpack_string_decode(const uint8_t *buf, size_t datalen, in hpack_string_decode() argument
249 if (datalen == 0) { in hpack_string_decode()
255 ret = hpack_integer_decode(buf, datalen, HPACK_STRING_PREFIX_LEN, in hpack_string_decode()
262 datalen -= ret; in hpack_string_decode()
265 if (str_len > datalen) { in hpack_string_decode()
289 static int hpack_handle_indexed(const uint8_t *buf, size_t datalen, in hpack_handle_indexed() argument
296 ret = hpack_integer_decode(buf, datalen, HPACK_PREFIX_LEN_INDEXED, in hpack_handle_indexed()
323 static int hpack_handle_literal(const uint8_t *buf, size_t datalen, in hpack_handle_literal() argument
330 header->datalen = 0; in hpack_handle_literal()
332 ret = hpack_integer_decode(buf, datalen, prefix_len, &index); in hpack_handle_literal()
339 datalen -= ret; in hpack_handle_literal()
343 ret = hpack_string_decode(buf, datalen, HPACK_HEADER_NAME, in hpack_handle_literal()
351 datalen -= ret; in hpack_handle_literal()
369 ret = hpack_string_decode(buf, datalen, HPACK_HEADER_VALUE, header); in hpack_handle_literal()
379 static int hpack_handle_literal_index(const uint8_t *buf, size_t datalen, in hpack_handle_literal_index() argument
384 return hpack_handle_literal(buf, datalen, header, in hpack_handle_literal_index()
388 static int hpack_handle_literal_no_index(const uint8_t *buf, size_t datalen, in hpack_handle_literal_no_index() argument
391 return hpack_handle_literal(buf, datalen, header, in hpack_handle_literal_no_index()
395 static int hpack_handle_dynamic_size_update(const uint8_t *buf, size_t datalen) in hpack_handle_dynamic_size_update() argument
401 buf, datalen, HPACK_PREFIX_LEN_DYNAMIC_TABLE_SIZE_UPDATE, &max_size); in hpack_handle_dynamic_size_update()
411 int http_hpack_decode_header(const uint8_t *buf, size_t datalen, in http_hpack_decode_header() argument
421 if (datalen == 0) { in http_hpack_decode_header()
428 ret = hpack_handle_indexed(buf, datalen, header); in http_hpack_decode_header()
431 ret = hpack_handle_literal_index(buf, datalen, header); in http_hpack_decode_header()
436 ret = hpack_handle_literal_no_index(buf, datalen, header); in http_hpack_decode_header()
439 ret = hpack_handle_dynamic_size_update(buf, datalen); in http_hpack_decode_header()