Lines Matching refs:nv

476 void nghttp2_hd_entry_init(nghttp2_hd_entry *ent, nghttp2_hd_nv *nv)  in nghttp2_hd_entry_init()  argument
478 ent->nv = *nv; in nghttp2_hd_entry_init()
479 ent->cnv.name = nv->name->base; in nghttp2_hd_entry_init()
480 ent->cnv.namelen = nv->name->len; in nghttp2_hd_entry_init()
481 ent->cnv.value = nv->value->base; in nghttp2_hd_entry_init()
482 ent->cnv.valuelen = nv->value->len; in nghttp2_hd_entry_init()
483 ent->cnv.flags = nv->flags; in nghttp2_hd_entry_init()
487 nghttp2_rcbuf_incref(ent->nv.name); in nghttp2_hd_entry_init()
488 nghttp2_rcbuf_incref(ent->nv.value); in nghttp2_hd_entry_init()
493 nghttp2_rcbuf_decref(ent->nv.value); in nghttp2_hd_entry_free()
494 nghttp2_rcbuf_decref(ent->nv.name); in nghttp2_hd_entry_free()
509 static uint32_t name_hash(const nghttp2_nv *nv) in name_hash() argument
515 for (i = 0; i < nv->namelen; ++i) { in name_hash()
516 h ^= nv->name[i]; in name_hash()
545 const nghttp2_nv *nv, int32_t token, in hd_map_find() argument
554 if (token != p->nv.token || in hd_map_find()
555 (token == -1 && (hash != p->hash || !name_eq(&p->nv, nv)))) { in hd_map_find()
564 if (value_eq(&p->nv, nv)) { in hd_map_find()
800 static void emit_header(nghttp2_hd_nv *nv_out, nghttp2_hd_nv *nv) in emit_header() argument
802 DEBUGF("inflatehd: header emission: %s: %s\n", nv->name->base, in emit_header()
803 nv->value->base); in emit_header()
806 *nv_out = *nv; in emit_header()
1056 const nghttp2_nv *nv, int indexing_mode) in emit_indname_block() argument
1072 idx, nv->valuelen, indexing_mode); in emit_indname_block()
1091 rv = emit_string(bufs, nv->value, nv->valuelen); in emit_indname_block()
1099 static int emit_newname_block(nghttp2_bufs *bufs, const nghttp2_nv *nv, in emit_newname_block() argument
1106 nv->namelen, nv->valuelen, indexing_mode); in emit_newname_block()
1113 rv = emit_string(bufs, nv->name, nv->namelen); in emit_newname_block()
1118 rv = emit_string(bufs, nv->value, nv->valuelen); in emit_newname_block()
1127 nghttp2_hd_nv *nv, nghttp2_hd_map *map, in add_hd_table_incremental() argument
1136 room = entry_room(nv->name->len, nv->value->len); in add_hd_table_incremental()
1144 entry_room(ent->nv.name->len, ent->nv.value->len); in add_hd_table_incremental()
1147 (char *)ent->nv.name->base, (char *)ent->nv.value->base); in add_hd_table_incremental()
1169 nghttp2_hd_entry_init(new_ent, nv); in add_hd_table_incremental()
1198 static search_result search_static_table(const nghttp2_nv *nv, int32_t token, in search_static_table() argument
1213 if (ent->value.len == nv->valuelen && in search_static_table()
1214 memcmp(ent->value.base, nv->value, nv->valuelen) == 0) { in search_static_table()
1224 const nghttp2_nv *nv, int32_t token, in search_hd_table() argument
1234 ent = hd_map_find(map, &exact_match, nv, token, hash, name_only); in search_hd_table()
1237 return search_static_table(nv, token, name_only); in search_hd_table()
1263 entry_room(ent->nv.name->len, ent->nv.value->len); in hd_context_shrink_table_size()
1338 ->nv; in nghttp2_hd_table_get()
1341 nghttp2_hd_nv nv = { &ent->name, &ent->value, ent->token, in nghttp2_hd_table_get() local
1343 return nv; in nghttp2_hd_table_get()
1361 const nghttp2_nv *nv, int32_t token) in hd_deflate_decide_indexing() argument
1368 entry_room(nv->namelen, nv->valuelen) > in hd_deflate_decide_indexing()
1377 const nghttp2_nv *nv) in deflate_nv() argument
1387 DEBUGF("deflatehd: deflating %.*s: %.*s\n", (int)nv->namelen, nv->name, in deflate_nv()
1388 (int)nv->valuelen, nv->value); in deflate_nv()
1392 token = lookup_token(nv->name, nv->namelen); in deflate_nv()
1394 hash = name_hash(nv); in deflate_nv()
1405 (token == NGHTTP2_TOKEN_COOKIE && nv->valuelen < 20) || in deflate_nv()
1406 (nv->flags & NGHTTP2_NV_FLAG_NO_INDEX) in deflate_nv()
1408 : hd_deflate_decide_indexing(deflater, nv, token); in deflate_nv()
1410 res = search_hd_table(&deflater->ctx, nv, token, indexing_mode, in deflate_nv()
1437 rv = nghttp2_rcbuf_new2(&hd_nv.name, nv->name, nv->namelen, mem); in deflate_nv()
1443 rv = nghttp2_rcbuf_new2(&hd_nv.value, nv->value, nv->valuelen, mem); in deflate_nv()
1464 rv = emit_newname_block(bufs, nv, indexing_mode); in deflate_nv()
1466 rv = emit_indname_block(bufs, (size_t)idx, nv, indexing_mode); in deflate_nv()
1476 nghttp2_bufs *bufs, const nghttp2_nv *nv, in nghttp2_hd_deflate_hd_bufs() argument
1510 rv = deflate_nv(deflater, bufs, &nv[i]); in nghttp2_hd_deflate_hd_bufs()
1527 size_t buflen, const nghttp2_nv *nv, size_t nvlen) in nghttp2_hd_deflate_hd() argument
1541 rv = nghttp2_hd_deflate_hd_bufs(deflater, &bufs, nv, nvlen); in nghttp2_hd_deflate_hd()
1560 const nghttp2_nv *nv, size_t nvlen) in nghttp2_hd_deflate_hd_vec() argument
1575 rv = nghttp2_hd_deflate_hd_bufs(deflater, &bufs, nv, nvlen); in nghttp2_hd_deflate_hd_vec()
1780 nghttp2_hd_nv nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index); in hd_inflate_commit_indexed() local
1782 emit_header(nv_out, &nv); in hd_inflate_commit_indexed()
1799 nghttp2_hd_nv nv; in hd_inflate_commit_newname() local
1803 nv.flags = NGHTTP2_NV_FLAG_NO_INDEX; in hd_inflate_commit_newname()
1805 nv.flags = NGHTTP2_NV_FLAG_NONE; in hd_inflate_commit_newname()
1808 nv.name = inflater->namercbuf; in hd_inflate_commit_newname()
1809 nv.value = inflater->valuercbuf; in hd_inflate_commit_newname()
1810 nv.token = in hd_inflate_commit_newname()
1814 rv = add_hd_table_incremental(&inflater->ctx, &nv, NULL, 0); in hd_inflate_commit_newname()
1821 emit_header(nv_out, &nv); in hd_inflate_commit_newname()
1823 inflater->nv_name_keep = nv.name; in hd_inflate_commit_newname()
1824 inflater->nv_value_keep = nv.value; in hd_inflate_commit_newname()
1846 nghttp2_hd_nv nv; in hd_inflate_commit_indname() local
1849 nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index); in hd_inflate_commit_indname()
1852 nv.flags = NGHTTP2_NV_FLAG_NO_INDEX; in hd_inflate_commit_indname()
1854 nv.flags = NGHTTP2_NV_FLAG_NONE; in hd_inflate_commit_indname()
1857 nghttp2_rcbuf_incref(nv.name); in hd_inflate_commit_indname()
1859 nv.value = inflater->valuercbuf; in hd_inflate_commit_indname()
1862 rv = add_hd_table_incremental(&inflater->ctx, &nv, NULL, 0); in hd_inflate_commit_indname()
1864 nghttp2_rcbuf_decref(nv.name); in hd_inflate_commit_indname()
1869 emit_header(nv_out, &nv); in hd_inflate_commit_indname()
1871 inflater->nv_name_keep = nv.name; in hd_inflate_commit_indname()
1872 inflater->nv_value_keep = nv.value; in hd_inflate_commit_indname()
2346 nghttp2_nv *nv, int indexing_mode) in nghttp2_hd_emit_indname_block() argument
2348 return emit_indname_block(bufs, idx, nv, indexing_mode); in nghttp2_hd_emit_indname_block()
2351 int nghttp2_hd_emit_newname_block(nghttp2_bufs *bufs, nghttp2_nv *nv, in nghttp2_hd_emit_newname_block() argument
2354 return emit_newname_block(bufs, nv, indexing_mode); in nghttp2_hd_emit_newname_block()