<div dir="ltr">description:<div>     when qpack header insert with name reference, if it is dynamic table, the index should be the relative index, as described in drafts:</div><div><a href="https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#name-insert-with-name-reference">https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#name-insert-with-name-reference</a> <br></div><div><br></div><div># HG changeset patch<br># User Zhiyong Sun <<a href="mailto:sunzhiyong3210@gmail.com">sunzhiyong3210@gmail.com</a>><br># Date 1621825861 14400<br>#      Sun May 23 23:11:01 2021 -0400<br># Branch quic<br># Node ID be8115b87d5abbd8d5e6afdccbcf2c0c2016113c<br># Parent  557dc6a06ba6ea7e78444067c4b8fbb022f7b191<br>convert qpack absolute index to relative index when lookup dynamic table<br><br>diff -r 557dc6a06ba6 -r be8115b87d5a src/http/v3/ngx_http_v3_tables.c<br>--- a/src/http/v3/ngx_http_v3_tables.c  Tue May 18 18:17:25 2021 +0300<br>+++ b/src/http/v3/ngx_http_v3_tables.c  Sun May 23 23:11:01 2021 -0400<br>@@ -159,9 +159,19 @@<br> ngx_http_v3_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic,<br>     ngx_uint_t index, ngx_str_t *value)<br> {<br>+    ngx_http_v3_connection_t     *h3c;<br>+    ngx_http_v3_dynamic_table_t  *dt;<br>     ngx_str_t  name;<br><br>     if (dynamic) {<br>+       h3c = c->quic->parent->data;<br>+        dt = &h3c->table;<br>+<br>+        if (dt->base + dt->nelts <= index) {<br>+            return NGX_HTTP_V3_ERR_ENCODER_STREAM_ERROR;<br>+        }<br>+<br>+        index = dt->base + dt->nelts - 1 - index;<br>         ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,<br>                        "http3 ref insert dynamic[%ui] \"%V\"", index, value);<br></div></div>