Mercurial > hg > nginx
comparison src/event/quic/ngx_event_quic.c @ 9048:9c427e98d8c1 quic
QUIC: treat qc->error == -1 as a missing error.
Previously, zero was used for this purpose. However, NGX_QUIC_ERR_NO_ERROR is
zero too. As a result, NGX_QUIC_ERR_NO_ERROR was changed to
NGX_QUIC_ERR_INTERNAL_ERROR when closing a QUIC connection.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Wed, 07 Sep 2022 12:37:15 +0400 |
parents | e50f77a2d0b0 |
children | 2b4891fa0fbc |
comparison
equal
deleted
inserted
replaced
9047:70ce1e927715 | 9048:9c427e98d8c1 |
---|---|
71 | 71 |
72 p = ngx_slprintf(p, last, "state:"); | 72 p = ngx_slprintf(p, last, "state:"); |
73 | 73 |
74 if (qc) { | 74 if (qc) { |
75 | 75 |
76 if (qc->error) { | 76 if (qc->error != (ngx_uint_t) -1) { |
77 p = ngx_slprintf(p, last, "%s", qc->error_app ? " app" : ""); | 77 p = ngx_slprintf(p, last, "%s", qc->error_app ? " app" : ""); |
78 p = ngx_slprintf(p, last, " error:%ui", qc->error); | 78 p = ngx_slprintf(p, last, " error:%ui", qc->error); |
79 | 79 |
80 if (qc->error_reason) { | 80 if (qc->error_reason) { |
81 p = ngx_slprintf(p, last, " \"%s\"", qc->error_reason); | 81 p = ngx_slprintf(p, last, " \"%s\"", qc->error_reason); |
521 ngx_add_timer(&qc->close, 3 * ngx_quic_pto(c, ctx)); | 521 ngx_add_timer(&qc->close, 3 * ngx_quic_pto(c, ctx)); |
522 | 522 |
523 qc->error = NGX_QUIC_ERR_NO_ERROR; | 523 qc->error = NGX_QUIC_ERR_NO_ERROR; |
524 | 524 |
525 } else { | 525 } else { |
526 if (qc->error == 0 && !qc->error_app) { | 526 if (qc->error == (ngx_uint_t) -1 && !qc->error_app) { |
527 qc->error = NGX_QUIC_ERR_INTERNAL_ERROR; | 527 qc->error = NGX_QUIC_ERR_INTERNAL_ERROR; |
528 } | 528 } |
529 | 529 |
530 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, | 530 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, |
531 "quic close immediate due to %serror: %ui %s", | 531 "quic close immediate due to %serror: %ui %s", |
937 ngx_quic_connection_t *qc; | 937 ngx_quic_connection_t *qc; |
938 static u_char buf[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE]; | 938 static u_char buf[NGX_QUIC_MAX_UDP_PAYLOAD_SIZE]; |
939 | 939 |
940 qc = ngx_quic_get_connection(c); | 940 qc = ngx_quic_get_connection(c); |
941 | 941 |
942 qc->error = 0; | 942 qc->error = (ngx_uint_t) -1; |
943 qc->error_reason = 0; | 943 qc->error_reason = 0; |
944 | 944 |
945 c->log->action = "decrypting packet"; | 945 c->log->action = "decrypting packet"; |
946 | 946 |
947 if (!ngx_quic_keys_available(qc->keys, pkt->level)) { | 947 if (!ngx_quic_keys_available(qc->keys, pkt->level)) { |