fix index type when looking up dynamic table
sun edward
sunzhiyong3210 at gmail.com
Mon May 24 03:13:08 UTC 2021
# HG changeset patch
# User Zhiyong Sun <sunzhiyong3210 at gmail.com>
# Date 1621825861 14400
# Sun May 23 23:11:01 2021 -0400
# Branch quic
# Node ID be8115b87d5abbd8d5e6afdccbcf2c0c2016113c
# Parent 557dc6a06ba6ea7e78444067c4b8fbb022f7b191
convert qpack absolute index to relative index when lookup dynamic table
diff -r 557dc6a06ba6 -r be8115b87d5a src/http/v3/ngx_http_v3_tables.c
--- a/src/http/v3/ngx_http_v3_tables.c Tue May 18 18:17:25 2021 +0300
+++ b/src/http/v3/ngx_http_v3_tables.c Sun May 23 23:11:01 2021 -0400
@@ -159,9 +159,19 @@
ngx_http_v3_ref_insert(ngx_connection_t *c, ngx_uint_t dynamic,
ngx_uint_t index, ngx_str_t *value)
{
+ ngx_http_v3_connection_t *h3c;
+ ngx_http_v3_dynamic_table_t *dt;
ngx_str_t name;
if (dynamic) {
+ h3c = c->quic->parent->data;
+ dt = &h3c->table;
+
+ if (dt->base + dt->nelts <= index) {
+ return NGX_HTTP_V3_ERR_ENCODER_STREAM_ERROR;
+ }
+
+ index = dt->base + dt->nelts - 1 - index;
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http3 ref insert dynamic[%ui] \"%V\"", index,
value);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20210524/ed958eba/attachment.htm>
More information about the nginx-devel
mailing list