summaryrefslogtreecommitdiffhomepage
path: root/src/event/quic/ngx_event_quic.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2023-08-25 13:51:38 +0400
committerSergey Kandaurov <pluknet@nginx.com>2023-08-25 13:51:38 +0400
commit24f3cb795e2d822be39387d828ac2ddc28f775fb (patch)
treeb887af0b576f764fb8980e530e28c9850560557d /src/event/quic/ngx_event_quic.c
parentf42519ff54c0ffecc2751f7957a5c3c9f1c53dfb (diff)
downloadnginx-24f3cb795e2d822be39387d828ac2ddc28f775fb.tar.gz
nginx-24f3cb795e2d822be39387d828ac2ddc28f775fb.tar.bz2
QUIC: posted generating TLS Key Update next keys.
Since at least f9fbeb4ee0de and certainly after 924882f42dea, which TLS Key Update support predates, queued data output is deferred to a posted push handler. To address timing signals after these changes, generating next keys is now posted to run after the push handler.
Diffstat (limited to 'src/event/quic/ngx_event_quic.c')
-rw-r--r--src/event/quic/ngx_event_quic.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c
index fb211cc9d..2d7cecbc0 100644
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -283,6 +283,10 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_quic_conf_t *conf,
qc->path_validation.data = c;
qc->path_validation.handler = ngx_quic_path_handler;
+ qc->key_update.log = c->log;
+ qc->key_update.data = c;
+ qc->key_update.handler = ngx_quic_keys_update;
+
qc->conf = conf;
if (ngx_quic_init_transport_params(&qc->tp, conf) != NGX_OK) {
@@ -562,6 +566,10 @@ ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc)
ngx_delete_posted_event(&qc->push);
}
+ if (qc->key_update.posted) {
+ ngx_delete_posted_event(&qc->key_update);
+ }
+
if (qc->close.timer_set) {
return;
}
@@ -1055,7 +1063,9 @@ ngx_quic_handle_payload(ngx_connection_t *c, ngx_quic_header_t *pkt)
return rc;
}
- return ngx_quic_keys_update(c, qc->keys);
+ ngx_post_event(&qc->key_update, &ngx_posted_events);
+
+ return NGX_OK;
}