Reuse name when indexing header by referencing dynamic table

This commit is contained in:
Tatsuhiro Tsujikawa 2019-03-04 23:22:18 +09:00
parent f5feb16ef4
commit 816ad2102f
1 changed files with 1 additions and 1 deletions

View File

@ -1390,7 +1390,7 @@ static int deflate_nv(nghttp2_hd_deflater *deflater, nghttp2_bufs *bufs,
if (indexing_mode == NGHTTP2_HD_WITH_INDEXING) { if (indexing_mode == NGHTTP2_HD_WITH_INDEXING) {
nghttp2_hd_nv hd_nv; nghttp2_hd_nv hd_nv;
if (idx != -1 && idx < (ssize_t)NGHTTP2_STATIC_TABLE_LENGTH) { if (idx != -1) {
hd_nv.name = nghttp2_hd_table_get(&deflater->ctx, (size_t)idx).name; hd_nv.name = nghttp2_hd_table_get(&deflater->ctx, (size_t)idx).name;
nghttp2_rcbuf_incref(hd_nv.name); nghttp2_rcbuf_incref(hd_nv.name);
} else { } else {