Lines Matching refs:buflen
215 size_t buflen = sizeof(header->buf) - header->datalen; in hpack_huffman_decode() local
220 ret = http_hpack_huffman_decode(encoded_buf, encoded_len, buf, buflen); in hpack_huffman_decode()
447 static int hpack_integer_encode(uint8_t *buf, size_t buflen, int value, in hpack_integer_encode() argument
453 if (buflen == 0) { in hpack_integer_encode()
469 if (len >= buflen) { in hpack_integer_encode()
478 if (len >= buflen) { in hpack_integer_encode()
488 static int hpack_string_encode(uint8_t *buf, size_t buflen, in hpack_string_encode() argument
516 ret = hpack_integer_encode(buf, buflen, str_len, prefix, in hpack_string_encode()
523 buflen -= ret; in hpack_string_encode()
527 if (str_len > buflen) { in hpack_string_encode()
537 static int hpack_encode_literal(uint8_t *buf, size_t buflen, in hpack_encode_literal() argument
542 ret = hpack_integer_encode(buf, buflen, 0, in hpack_encode_literal()
550 buflen -= ret; in hpack_encode_literal()
553 ret = hpack_string_encode(buf, buflen, HPACK_HEADER_NAME, header); in hpack_encode_literal()
559 buflen -= ret; in hpack_encode_literal()
562 ret = hpack_string_encode(buf, buflen, HPACK_HEADER_VALUE, header); in hpack_encode_literal()
572 static int hpack_encode_literal_value(uint8_t *buf, size_t buflen, int index, in hpack_encode_literal_value() argument
577 ret = hpack_integer_encode(buf, buflen, index, in hpack_encode_literal_value()
585 buflen -= ret; in hpack_encode_literal_value()
588 ret = hpack_string_encode(buf, buflen, HPACK_HEADER_VALUE, header); in hpack_encode_literal_value()
598 static int hpack_encode_indexed(uint8_t *buf, size_t buflen, int index) in hpack_encode_indexed() argument
600 return hpack_integer_encode(buf, buflen, index, HPACK_PREFIX_INDEXED, in hpack_encode_indexed()
604 int http_hpack_encode_header(uint8_t *buf, size_t buflen, in http_hpack_encode_header() argument
616 if (buflen == 0) { in http_hpack_encode_header()
623 len = hpack_encode_literal(buf, buflen, header); in http_hpack_encode_header()
626 len = hpack_encode_literal_value(buf, buflen, ret, header); in http_hpack_encode_header()
629 len = hpack_encode_indexed(buf, buflen, ret); in http_hpack_encode_header()