QUIC: renaming.
The c->quic->retransmit timer is now called "pto". The ngx_quic_retransmit() function is renamed to "ngx_quic_detect_lost()". This is a preparation for the following patches.
This commit is contained in:
parent
fa72cd0ce7
commit
37d1ec06ef
1 changed files with 16 additions and 18 deletions
|
@ -94,7 +94,7 @@ struct ngx_quic_connection_s {
|
||||||
ngx_ssl_t *ssl;
|
ngx_ssl_t *ssl;
|
||||||
|
|
||||||
ngx_event_t push;
|
ngx_event_t push;
|
||||||
ngx_event_t retransmit;
|
ngx_event_t pto;
|
||||||
ngx_event_t close;
|
ngx_event_t close;
|
||||||
ngx_queue_t free_frames;
|
ngx_queue_t free_frames;
|
||||||
ngx_msec_t last_cc;
|
ngx_msec_t last_cc;
|
||||||
|
@ -245,8 +245,8 @@ static ngx_int_t ngx_quic_send_frames(ngx_connection_t *c, ngx_queue_t *frames);
|
||||||
|
|
||||||
static void ngx_quic_set_packet_number(ngx_quic_header_t *pkt,
|
static void ngx_quic_set_packet_number(ngx_quic_header_t *pkt,
|
||||||
ngx_quic_send_ctx_t *ctx);
|
ngx_quic_send_ctx_t *ctx);
|
||||||
static void ngx_quic_retransmit_handler(ngx_event_t *ev);
|
static void ngx_quic_pto_handler(ngx_event_t *ev);
|
||||||
static ngx_int_t ngx_quic_retransmit(ngx_connection_t *c,
|
static ngx_int_t ngx_quic_detect_lost(ngx_connection_t *c,
|
||||||
ngx_quic_send_ctx_t *ctx, ngx_msec_t *waitp);
|
ngx_quic_send_ctx_t *ctx, ngx_msec_t *waitp);
|
||||||
static void ngx_quic_push_handler(ngx_event_t *ev);
|
static void ngx_quic_push_handler(ngx_event_t *ev);
|
||||||
|
|
||||||
|
@ -683,10 +683,10 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_tp_t *tp,
|
||||||
* qc->latest_rtt = 0
|
* qc->latest_rtt = 0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
qc->retransmit.log = c->log;
|
qc->pto.log = c->log;
|
||||||
qc->retransmit.data = c;
|
qc->pto.data = c;
|
||||||
qc->retransmit.handler = ngx_quic_retransmit_handler;
|
qc->pto.handler = ngx_quic_pto_handler;
|
||||||
qc->retransmit.cancelable = 1;
|
qc->pto.cancelable = 1;
|
||||||
|
|
||||||
qc->push.log = c->log;
|
qc->push.log = c->log;
|
||||||
qc->push.data = c;
|
qc->push.data = c;
|
||||||
|
@ -1388,8 +1388,8 @@ ngx_quic_close_quic(ngx_connection_t *c, ngx_int_t rc)
|
||||||
ngx_del_timer(&qc->push);
|
ngx_del_timer(&qc->push);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qc->retransmit.timer_set) {
|
if (qc->pto.timer_set) {
|
||||||
ngx_del_timer(&qc->retransmit);
|
ngx_del_timer(&qc->pto);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qc->push.posted) {
|
if (qc->push.posted) {
|
||||||
|
@ -3260,9 +3260,8 @@ ngx_quic_output(ngx_connection_t *c)
|
||||||
ngx_add_timer(c->read, qc->tp.max_idle_timeout);
|
ngx_add_timer(c->read, qc->tp.max_idle_timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qc->retransmit.timer_set && !qc->closing) {
|
if (!qc->pto.timer_set && !qc->closing) {
|
||||||
ngx_add_timer(&qc->retransmit,
|
ngx_add_timer(&qc->pto, qc->ctp.max_ack_delay + NGX_QUIC_HARDCODED_PTO);
|
||||||
qc->ctp.max_ack_delay + NGX_QUIC_HARDCODED_PTO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
|
@ -3543,15 +3542,14 @@ ngx_quic_set_packet_number(ngx_quic_header_t *pkt, ngx_quic_send_ctx_t *ctx)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ngx_quic_retransmit_handler(ngx_event_t *ev)
|
ngx_quic_pto_handler(ngx_event_t *ev)
|
||||||
{
|
{
|
||||||
ngx_uint_t i;
|
ngx_uint_t i;
|
||||||
ngx_msec_t wait, nswait;
|
ngx_msec_t wait, nswait;
|
||||||
ngx_connection_t *c;
|
ngx_connection_t *c;
|
||||||
ngx_quic_connection_t *qc;
|
ngx_quic_connection_t *qc;
|
||||||
|
|
||||||
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0,
|
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, ev->log, 0, "quic pto timer");
|
||||||
"quic retransmit timer");
|
|
||||||
|
|
||||||
c = ev->data;
|
c = ev->data;
|
||||||
qc = c->quic;
|
qc = c->quic;
|
||||||
|
@ -3559,7 +3557,7 @@ ngx_quic_retransmit_handler(ngx_event_t *ev)
|
||||||
wait = 0;
|
wait = 0;
|
||||||
|
|
||||||
for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) {
|
for (i = 0; i < NGX_QUIC_SEND_CTX_LAST; i++) {
|
||||||
if (ngx_quic_retransmit(c, &qc->send_ctx[i], &nswait) != NGX_OK) {
|
if (ngx_quic_detect_lost(c, &qc->send_ctx[i], &nswait) != NGX_OK) {
|
||||||
ngx_quic_close_connection(c, NGX_ERROR);
|
ngx_quic_close_connection(c, NGX_ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3573,7 +3571,7 @@ ngx_quic_retransmit_handler(ngx_event_t *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wait > 0) {
|
if (wait > 0) {
|
||||||
ngx_add_timer(&qc->retransmit, wait);
|
ngx_add_timer(&qc->pto, wait);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3595,7 +3593,7 @@ ngx_quic_push_handler(ngx_event_t *ev)
|
||||||
|
|
||||||
|
|
||||||
static ngx_int_t
|
static ngx_int_t
|
||||||
ngx_quic_retransmit(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
|
ngx_quic_detect_lost(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx,
|
||||||
ngx_msec_t *waitp)
|
ngx_msec_t *waitp)
|
||||||
{
|
{
|
||||||
uint64_t pn;
|
uint64_t pn;
|
||||||
|
|
Loading…
Reference in a new issue