QUIC: updated c->log->action strings to reflect proper state.

This commit is contained in:
Vladimir Homutov 2020-10-07 13:38:17 +03:00
parent 7250a7688d
commit 7369bdc47c

View File

@ -643,8 +643,6 @@ ngx_quic_run(ngx_connection_t *c, ngx_quic_conf_t *conf)
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "quic run"); ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, 0, "quic run");
c->log->action = "QUIC initialization";
rc = ngx_quic_input(c, c->buffer, conf); rc = ngx_quic_input(c, c->buffer, conf);
if (rc != NGX_OK) { if (rc != NGX_OK) {
ngx_quic_close_connection(c, rc == NGX_DECLINED ? NGX_DONE : NGX_ERROR); ngx_quic_close_connection(c, rc == NGX_DECLINED ? NGX_DONE : NGX_ERROR);
@ -669,8 +667,6 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_quic_conf_t *conf,
ngx_quic_client_id_t *cid; ngx_quic_client_id_t *cid;
ngx_quic_connection_t *qc; ngx_quic_connection_t *qc;
c->log->action = "creating new quic connection";
qc = ngx_pcalloc(c->pool, sizeof(ngx_quic_connection_t)); qc = ngx_pcalloc(c->pool, sizeof(ngx_quic_connection_t));
if (qc == NULL) { if (qc == NULL) {
return NULL; return NULL;
@ -1300,6 +1296,8 @@ ngx_quic_input_handler(ngx_event_t *rev)
ngx_quic_connection_t *qc; ngx_quic_connection_t *qc;
static u_char buf[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE]; static u_char buf[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE];
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, rev->log, 0, "quic input handler");
ngx_memzero(&b, sizeof(ngx_buf_t)); ngx_memzero(&b, sizeof(ngx_buf_t));
b.start = buf; b.start = buf;
b.end = buf + sizeof(buf); b.end = buf + sizeof(buf);
@ -1309,7 +1307,7 @@ ngx_quic_input_handler(ngx_event_t *rev)
c = rev->data; c = rev->data;
qc = c->quic; qc = c->quic;
ngx_log_debug0(NGX_LOG_DEBUG_EVENT, rev->log, 0, "quic input handler"); c->log->action = "handling quic input";
if (rev->timedout) { if (rev->timedout) {
ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT, ngx_log_error(NGX_LOG_INFO, c->log, NGX_ETIMEDOUT,
@ -1618,7 +1616,6 @@ ngx_quic_input(ngx_connection_t *c, ngx_buf_t *b, ngx_quic_conf_t *conf)
p = b->pos; p = b->pos;
while (p < b->last) { while (p < b->last) {
c->log->action = "processing quic packet";
ngx_memzero(&pkt, sizeof(ngx_quic_header_t)); ngx_memzero(&pkt, sizeof(ngx_quic_header_t));
pkt.raw = b; pkt.raw = b;
@ -1684,12 +1681,16 @@ ngx_quic_process_packet(ngx_connection_t *c, ngx_quic_conf_t *conf,
static u_char buf[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE]; static u_char buf[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE];
c->log->action = "parsing quic packet";
rc = ngx_quic_parse_packet(pkt); rc = ngx_quic_parse_packet(pkt);
if (rc == NGX_DECLINED || rc == NGX_ERROR) { if (rc == NGX_DECLINED || rc == NGX_ERROR) {
return rc; return rc;
} }
c->log->action = "processing quic packet";
qc = c->quic; qc = c->quic;
if (qc) { if (qc) {
@ -1759,6 +1760,8 @@ ngx_quic_process_packet(ngx_connection_t *c, ngx_quic_conf_t *conf,
if (pkt->level == ssl_encryption_initial) { if (pkt->level == ssl_encryption_initial) {
c->log->action = "creating quic connection";
if (pkt->dcid.len < NGX_QUIC_CID_LEN_MIN) { if (pkt->dcid.len < NGX_QUIC_CID_LEN_MIN) {
/* 7.2. Negotiating Connection IDs */ /* 7.2. Negotiating Connection IDs */
ngx_log_error(NGX_LOG_INFO, c->log, 0, ngx_log_error(NGX_LOG_INFO, c->log, 0,
@ -1800,6 +1803,8 @@ ngx_quic_process_packet(ngx_connection_t *c, ngx_quic_conf_t *conf,
} }
} }
c->log->action = "decrypting packet";
keys = &qc->keys[pkt->level]; keys = &qc->keys[pkt->level];
if (keys->client.key.len == 0) { if (keys->client.key.len == 0) {
@ -1847,6 +1852,8 @@ ngx_quic_process_packet(ngx_connection_t *c, ngx_quic_conf_t *conf,
ngx_gettimeofday(&pkt->received); ngx_gettimeofday(&pkt->received);
} }
c->log->action = "handling payload";
if (pkt->level != ssl_encryption_application) { if (pkt->level != ssl_encryption_application) {
return ngx_quic_payload_handler(c, pkt); return ngx_quic_payload_handler(c, pkt);
} }