diff src/http/v3/ngx_http_v3_streams.c @ 8719:5cb5b568282b quic

HTTP/3: do not push until a MAX_PUSH_ID frame is received. Fixes interop with quic-go that doesn't send MAX_PUSH_ID.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 16 Mar 2021 13:48:29 +0300
parents e1eb7f4ca9f1
children 265062a99043
line wrap: on
line diff
--- a/src/http/v3/ngx_http_v3_streams.c
+++ b/src/http/v3/ngx_http_v3_streams.c
@@ -62,6 +62,7 @@ ngx_http_v3_init_session(ngx_connection_
 
     h3c->hc = *phc;
     h3c->hc.http3 = 1;
+    h3c->max_push_id = (uint64_t) -1;
 
     ngx_queue_init(&h3c->blocked);
     ngx_queue_init(&h3c->pushing);
@@ -762,7 +763,7 @@ ngx_http_v3_set_max_push_id(ngx_connecti
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
                    "http3 MAX_PUSH_ID:%uL", max_push_id);
 
-    if (max_push_id < h3c->max_push_id) {
+    if (h3c->max_push_id != (uint64_t) -1 && max_push_id < h3c->max_push_id) {
         return NGX_HTTP_V3_ERR_ID_ERROR;
     }