Lines Matching full:header
104 static int http_hpack_find_index(struct http_hpack_header_buf *header, in http_hpack_find_index() argument
115 strlen(entry->name) == header->name_len && in http_hpack_find_index()
116 memcmp(entry->name, header->name, header->name_len) == 0) { in http_hpack_find_index()
118 strlen(entry->value) == header->value_len && in http_hpack_find_index()
119 memcmp(entry->value, header->value, header->value_len) == 0) { in http_hpack_find_index()
212 struct http_hpack_header_buf *header) in hpack_huffman_decode() argument
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()
226 header->name = buf; in hpack_huffman_decode()
227 header->name_len = ret; in hpack_huffman_decode()
229 header->value = buf; in hpack_huffman_decode()
230 header->value_len = ret; in hpack_huffman_decode()
233 header->datalen += ret; in hpack_huffman_decode()
240 struct http_hpack_header_buf *header) in hpack_string_decode() argument
270 ret = hpack_huffman_decode(buf, str_len, type, header); in hpack_string_decode()
276 header->name = buf; in hpack_string_decode()
277 header->name_len = str_len; in hpack_string_decode()
279 header->value = buf; in hpack_string_decode()
280 header->value_len = str_len; in hpack_string_decode()
290 struct http_hpack_header_buf *header) in hpack_handle_indexed() argument
315 header->name = entry->name; in hpack_handle_indexed()
316 header->name_len = strlen(entry->name); in hpack_handle_indexed()
317 header->value = entry->value; in hpack_handle_indexed()
318 header->value_len = strlen(entry->value); in hpack_handle_indexed()
324 struct http_hpack_header_buf *header, in hpack_handle_literal() argument
330 header->datalen = 0; in hpack_handle_literal()
344 header); in hpack_handle_literal()
365 header->name = entry->name; in hpack_handle_literal()
366 header->name_len = strlen(entry->name); in hpack_handle_literal()
369 ret = hpack_string_decode(buf, datalen, HPACK_HEADER_VALUE, header); in hpack_handle_literal()
380 struct http_hpack_header_buf *header) in hpack_handle_literal_index() argument
384 return hpack_handle_literal(buf, datalen, header, in hpack_handle_literal_index()
389 struct http_hpack_header_buf *header) in hpack_handle_literal_no_index() argument
391 return hpack_handle_literal(buf, datalen, header, in hpack_handle_literal_no_index()
412 struct http_hpack_header_buf *header) in http_hpack_decode_header() argument
417 if (buf == NULL || header == NULL) { 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()
490 struct http_hpack_header_buf *header) in hpack_string_encode() argument
498 str = header->name; in hpack_string_encode()
499 str_len = header->name_len; in hpack_string_encode()
501 str = header->value; in hpack_string_encode()
502 str_len = header->value_len; in hpack_string_encode()
506 ret = http_hpack_huffman_encode(str, str_len, header->buf, in hpack_string_encode()
507 sizeof(header->buf)); in hpack_string_encode()
510 str = header->buf; in hpack_string_encode()
538 struct http_hpack_header_buf *header) in hpack_encode_literal() argument
553 ret = hpack_string_encode(buf, buflen, HPACK_HEADER_NAME, header); in hpack_encode_literal()
562 ret = hpack_string_encode(buf, buflen, HPACK_HEADER_VALUE, header); in hpack_encode_literal()
573 struct http_hpack_header_buf *header) in hpack_encode_literal_value() argument
588 ret = hpack_string_encode(buf, buflen, HPACK_HEADER_VALUE, header); in hpack_encode_literal_value()
605 struct http_hpack_header_buf *header) in http_hpack_encode_header() argument
610 if (buf == NULL || header == NULL || in http_hpack_encode_header()
611 header->name == NULL || header->name_len == 0 || in http_hpack_encode_header()
612 header->value == NULL || header->value_len == 0) { in http_hpack_encode_header()
620 ret = http_hpack_find_index(header, &name_only); 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()