Welcome! Log In Create A New Profile

Advanced

[PATCH] QUIC: fixed $connection_time

Sergey Kandaurov
January 10, 2023 08:36AM
# HG changeset patch
# User Sergey Kandaurov <pluknet@nginx.com>
# Date 1673354510 -14400
# Tue Jan 10 16:41:50 2023 +0400
# Branch quic
# Node ID 267dbbc62495f5481224c956145697a91364e532
# Parent 19633ad7b73cba34e61f5619193cbcac2f949947
QUIC: fixed $connection_time.

Previously, start_time wasn't set for a new stream.
The fix is to derive it from the parent connection.
Additionally, it's used to simplify keepalive_time.

diff --git a/src/event/quic/ngx_event_quic_streams.c b/src/event/quic/ngx_event_quic_streams.c
--- a/src/event/quic/ngx_event_quic_streams.c
+++ b/src/event/quic/ngx_event_quic_streams.c
@@ -689,6 +689,7 @@ ngx_quic_create_stream(ngx_connection_t
sc->local_sockaddr = c->local_sockaddr;
sc->local_socklen = c->local_socklen;
sc->number = ngx_atomic_fetch_add(ngx_connection_counter, 1);
+ sc->start_time = c->start_time;
sc->tcp_nodelay = NGX_TCP_NODELAY_DISABLED;

sc->recv = ngx_quic_stream_recv;
diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c
--- a/src/http/v3/ngx_http_v3_request.c
+++ b/src/http/v3/ngx_http_v3_request.c
@@ -165,7 +165,6 @@ ngx_http_v3_init_request_stream(ngx_conn
{
uint64_t n;
ngx_event_t *rev;
- ngx_connection_t *pc;
ngx_pool_cleanup_t *cln;
ngx_http_connection_t *hc;
ngx_http_v3_session_t *h3c;
@@ -199,12 +198,10 @@ ngx_http_v3_init_request_stream(ngx_conn
return;
}

- pc = c->quic->parent;
-
h3c->next_request_id = c->quic->id + 0x04;

if (n + 1 == clcf->keepalive_requests
- || ngx_current_msec - pc->start_time > clcf->keepalive_time)
+ || ngx_current_msec - c->start_time > clcf->keepalive_time)
{
h3c->goaway = 1;

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] QUIC: fixed $connection_time

Sergey Kandaurov 332 January 10, 2023 08:36AM

Re: [PATCH] QUIC: fixed $connection_time

Roman Arutyunyan 110 January 10, 2023 08:42AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 275
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready