diff options
author | Roman Arutyunyan <arut@nginx.com> | 2020-07-02 15:34:05 +0300 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2020-07-02 15:34:05 +0300 |
commit | a687d08062d8cb029ab82249aa55833cf44be3ce (patch) | |
tree | 57ab07f1a9e3471ba1b43e6635bcde4094277bc7 /src/http/ngx_http_request.c | |
parent | a7ef0da3c8b64f2b5f4d8a7e73e724a74611284c (diff) | |
download | nginx-a687d08062d8cb029ab82249aa55833cf44be3ce.tar.gz nginx-a687d08062d8cb029ab82249aa55833cf44be3ce.zip |
HTTP/3: refactored dynamic table implementation.
Previously dynamic table was not functional because of zero limit on its size
set by default. Now the following changes enable it:
- new directives to set SETTINGS_QPACK_MAX_TABLE_CAPACITY and
SETTINGS_QPACK_BLOCKED_STREAMS
- send settings with SETTINGS_QPACK_MAX_TABLE_CAPACITY and
SETTINGS_QPACK_BLOCKED_STREAMS to the client
- send Insert Count Increment to the client
- send Header Acknowledgement to the client
- evict old dynamic table entries on overflow
- decode Required Insert Count from client
- block stream if Required Insert Count is not reached
Diffstat (limited to 'src/http/ngx_http_request.c')
-rw-r--r-- | src/http/ngx_http_request.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index ac5937347..89e554bf2 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -223,7 +223,17 @@ ngx_http_init_connection(ngx_connection_t *c) #if (NGX_HTTP_V3) if (c->type == SOCK_DGRAM) { - hc = ngx_pcalloc(c->pool, sizeof(ngx_http_v3_connection_t)); + ngx_http_v3_connection_t *h3c; + + h3c = ngx_pcalloc(c->pool, sizeof(ngx_http_v3_connection_t)); + if (h3c == NULL) { + ngx_http_close_connection(c); + return; + } + + ngx_queue_init(&h3c->blocked); + + hc = &h3c->hc; hc->quic = 1; hc->ssl = 1; @@ -414,6 +424,13 @@ ngx_http_quic_stream_handler(ngx_connection_t *c) pc = c->qs->parent; h3c = pc->data; + if (!h3c->settings_sent) { + h3c->settings_sent = 1; + + /* TODO close QUIC connection on error */ + (void) ngx_http_v3_send_settings(c); + } + if (c->qs->id & NGX_QUIC_STREAM_UNIDIRECTIONAL) { ngx_http_v3_handle_client_uni_stream(c); return; @@ -1255,7 +1272,7 @@ ngx_http_process_request_line(ngx_event_t *rev) break; } - if (rc == NGX_DONE) { + if (rc == NGX_BUSY) { if (ngx_handle_read_event(rev, 0) != NGX_OK) { ngx_http_close_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return; |