Lines Matching refs:nv
487 void nghttp2_hd_entry_init(nghttp2_hd_entry *ent, nghttp2_hd_nv *nv) {
488 ent->nv = *nv;
489 ent->cnv.name = nv->name->base;
490 ent->cnv.namelen = nv->name->len;
491 ent->cnv.value = nv->value->base;
492 ent->cnv.valuelen = nv->value->len;
493 ent->cnv.flags = nv->flags;
497 nghttp2_rcbuf_incref(ent->nv.name);
498 nghttp2_rcbuf_incref(ent->nv.value);
502 nghttp2_rcbuf_decref(ent->nv.value);
503 nghttp2_rcbuf_decref(ent->nv.name);
516 static uint32_t name_hash(const nghttp2_nv *nv) {
521 for (i = 0; i < nv->namelen; ++i) {
522 h ^= nv->name[i];
549 const nghttp2_nv *nv, int32_t token,
557 if (token != p->nv.token ||
558 (token == -1 && (hash != p->hash || !name_eq(&p->nv, nv)))) {
567 if (value_eq(&p->nv, nv)) {
786 static void emit_header(nghttp2_hd_nv *nv_out, nghttp2_hd_nv *nv) {
787 DEBUGF("inflatehd: header emission: %s: %s\n", nv->name->base,
788 nv->value->base);
791 *nv_out = *nv;
1033 const nghttp2_nv *nv, int indexing_mode) {
1047 idx, nv->valuelen, indexing_mode);
1066 rv = emit_string(bufs, nv->value, nv->valuelen);
1074 static int emit_newname_block(nghttp2_bufs *bufs, const nghttp2_nv *nv,
1080 nv->namelen, nv->valuelen, indexing_mode);
1087 rv = emit_string(bufs, nv->name, nv->namelen);
1092 rv = emit_string(bufs, nv->value, nv->valuelen);
1101 nghttp2_hd_nv *nv, nghttp2_hd_map *map,
1109 room = entry_room(nv->name->len, nv->value->len);
1118 entry_room(ent->nv.name->len, ent->nv.value->len);
1121 (char *)ent->nv.name->base, (char *)ent->nv.value->base);
1143 nghttp2_hd_entry_init(new_ent, nv);
1172 static search_result search_static_table(const nghttp2_nv *nv, int32_t token,
1186 if (ent->value.len == nv->valuelen &&
1187 memcmp(ent->value.base, nv->value, nv->valuelen) == 0) {
1197 const nghttp2_nv *nv, int32_t token,
1206 ent = hd_map_find(map, &exact_match, nv, token, hash, name_only);
1209 return search_static_table(nv, token, name_only);
1234 entry_room(ent->nv.name->len, ent->nv.value->len);
1305 ->nv;
1308 nghttp2_hd_nv nv = {(nghttp2_rcbuf *)&ent->name,
1311 return nv;
1328 const nghttp2_nv *nv, int32_t token) {
1334 entry_room(nv->namelen, nv->valuelen) >
1343 const nghttp2_nv *nv) {
1352 DEBUGF("deflatehd: deflating %.*s: %.*s\n", (int)nv->namelen, nv->name,
1353 (int)nv->valuelen, nv->value);
1357 token = lookup_token(nv->name, nv->namelen);
1359 hash = name_hash(nv);
1370 (token == NGHTTP2_TOKEN_COOKIE && nv->valuelen < 20) ||
1371 (nv->flags & NGHTTP2_NV_FLAG_NO_INDEX)
1373 : hd_deflate_decide_indexing(deflater, nv, token);
1375 res = search_hd_table(&deflater->ctx, nv, token, indexing_mode,
1403 rv = nghttp2_rcbuf_new2(&hd_nv.name, nv->name, nv->namelen, mem);
1409 rv = nghttp2_rcbuf_new2(&hd_nv.value, nv->value, nv->valuelen, mem);
1429 rv = emit_newname_block(bufs, nv, indexing_mode);
1431 rv = emit_indname_block(bufs, (size_t)idx, nv, indexing_mode);
1441 nghttp2_bufs *bufs, const nghttp2_nv *nv,
1475 rv = deflate_nv(deflater, bufs, &nv[i]);
1492 size_t buflen, const nghttp2_nv *nv,
1506 rv = nghttp2_hd_deflate_hd_bufs(deflater, &bufs, nv, nvlen);
1525 const nghttp2_nv *nv, size_t nvlen) {
1539 rv = nghttp2_hd_deflate_hd_bufs(deflater, &bufs, nv, nvlen);
1740 nghttp2_hd_nv nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index);
1742 emit_header(nv_out, &nv);
1758 nghttp2_hd_nv nv;
1762 nv.flags = NGHTTP2_NV_FLAG_NO_INDEX;
1764 nv.flags = NGHTTP2_NV_FLAG_NONE;
1767 nv.name = inflater->namercbuf;
1768 nv.value = inflater->valuercbuf;
1769 nv.token = lookup_token(inflater->namercbuf->base, inflater->namercbuf->len);
1772 rv = add_hd_table_incremental(&inflater->ctx, &nv, NULL, 0);
1779 emit_header(nv_out, &nv);
1781 inflater->nv_name_keep = nv.name;
1782 inflater->nv_value_keep = nv.value;
1803 nghttp2_hd_nv nv;
1806 nv = nghttp2_hd_table_get(&inflater->ctx, inflater->index);
1809 nv.flags = NGHTTP2_NV_FLAG_NO_INDEX;
1811 nv.flags = NGHTTP2_NV_FLAG_NONE;
1814 nghttp2_rcbuf_incref(nv.name);
1816 nv.value = inflater->valuercbuf;
1819 rv = add_hd_table_incremental(&inflater->ctx, &nv, NULL, 0);
1821 nghttp2_rcbuf_decref(nv.name);
1826 emit_header(nv_out, &nv);
1828 inflater->nv_name_keep = nv.name;
1829 inflater->nv_value_keep = nv.value;
2286 nghttp2_nv *nv, int indexing_mode) {
2288 return emit_indname_block(bufs, idx, nv, indexing_mode);
2291 int nghttp2_hd_emit_newname_block(nghttp2_bufs *bufs, nghttp2_nv *nv,
2293 return emit_newname_block(bufs, nv, indexing_mode);