Latest update - 9163
This commit is contained in:
@@ -211,6 +211,8 @@ ngx_quic_run(ngx_connection_t *c, ngx_quic_conf_t *conf)
|
||||
qc = ngx_quic_get_connection(c);
|
||||
|
||||
ngx_add_timer(c->read, qc->tp.max_idle_timeout);
|
||||
ngx_add_timer(&qc->close, qc->conf->handshake_timeout);
|
||||
|
||||
ngx_quic_connstate_dbg(c);
|
||||
|
||||
c->read->handler = ngx_quic_input_handler;
|
||||
@@ -418,7 +420,7 @@ ngx_quic_input_handler(ngx_event_t *rev)
|
||||
if (c->close) {
|
||||
c->close = 0;
|
||||
|
||||
if (!ngx_exiting) {
|
||||
if (!ngx_exiting || !qc->streams.initialized) {
|
||||
qc->error = NGX_QUIC_ERR_NO_ERROR;
|
||||
qc->error_reason = "graceful shutdown";
|
||||
ngx_quic_close_connection(c, NGX_ERROR);
|
||||
@@ -485,6 +487,10 @@ ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc)
|
||||
ngx_quic_free_frames(c, &qc->send_ctx[i].sent);
|
||||
}
|
||||
|
||||
if (qc->close.timer_set) {
|
||||
ngx_del_timer(&qc->close);
|
||||
}
|
||||
|
||||
if (rc == NGX_DONE) {
|
||||
|
||||
/*
|
||||
@@ -531,7 +537,7 @@ ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc)
|
||||
qc->error_level = ctx->level;
|
||||
(void) ngx_quic_send_cc(c);
|
||||
|
||||
if (rc == NGX_OK && !qc->close.timer_set) {
|
||||
if (rc == NGX_OK) {
|
||||
ngx_add_timer(&qc->close, 3 * ngx_quic_pto(c, ctx));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ typedef struct {
|
||||
ngx_flag_t retry;
|
||||
ngx_flag_t gso_enabled;
|
||||
ngx_flag_t disable_active_migration;
|
||||
ngx_msec_t timeout;
|
||||
ngx_msec_t handshake_timeout;
|
||||
ngx_msec_t idle_timeout;
|
||||
ngx_str_t host_key;
|
||||
size_t stream_buffer_size;
|
||||
ngx_uint_t max_concurrent_streams_bidi;
|
||||
|
||||
@@ -630,6 +630,10 @@ ngx_quic_do_init_streams(ngx_connection_t *c)
|
||||
|
||||
qc->streams.initialized = 1;
|
||||
|
||||
if (!qc->closing && qc->close.timer_set) {
|
||||
ngx_del_timer(&qc->close);
|
||||
}
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1985,7 +1985,7 @@ ngx_quic_init_transport_params(ngx_quic_tp_t *tp, ngx_quic_conf_t *qcf)
|
||||
* tp->preferred_address = NULL
|
||||
*/
|
||||
|
||||
tp->max_idle_timeout = qcf->timeout;
|
||||
tp->max_idle_timeout = qcf->idle_timeout;
|
||||
|
||||
tp->max_udp_payload_size = NGX_QUIC_MAX_UDP_PAYLOAD_SIZE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user