From 0277c8f6dd1067dd6d2939238ea338bd1ed1cb9f Mon Sep 17 00:00:00 2001 From: drawing Date: Wed, 11 Jun 2025 23:43:28 +0800 Subject: [PATCH] fix http3 ssl_handshake_time variable --- modules/ngx_http_xquic_module/ngx_http_xquic.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/modules/ngx_http_xquic_module/ngx_http_xquic.c b/modules/ngx_http_xquic_module/ngx_http_xquic.c index 33bbf8415f..dd98a7537d 100644 --- a/modules/ngx_http_xquic_module/ngx_http_xquic.c +++ b/modules/ngx_http_xquic_module/ngx_http_xquic.c @@ -310,6 +310,12 @@ ngx_http_v3_conn_create_notify(xqc_h3_conn_t *h3_conn, p_ssl->connection = user_conn->ssl_conn; c->ssl = p_ssl; +#if (T_NGX_SSL_HANDSHAKE_TIME) + /* ssl handshake start time */ + ngx_time_t *tp = ngx_timeofday(); + c->ssl->handshake_start_msec = tp->sec * 1000 + tp->msec; +#endif + return NGX_OK; } @@ -348,6 +354,14 @@ ngx_http_v3_conn_handshake_finished(xqc_h3_conn_t *h3_conn, void *user_data) /* TODO */ +#if (T_NGX_SSL_HANDSHAKE_TIME) + ngx_connection_t *c = user_conn->connection; + if (c != NULL) { + ngx_time_t *tp; + tp = ngx_timeofday(); + c->ssl->handshake_end_msec = tp->sec * 1000 + tp->msec; + } +#endif }