diff options
author | Roman Arutyunyan <arut@nginx.com> | 2022-09-07 12:37:15 +0400 |
---|---|---|
committer | Roman Arutyunyan <arut@nginx.com> | 2022-09-07 12:37:15 +0400 |
commit | d3fb12d77fad66eba2d8db102e505000c2a80e6d (patch) | |
tree | 1f18737248e7ed4a52de7e2ea4152e3ba6f8ac1e | |
parent | d3294e61d598021554b91dd350c2dcd33c55887d (diff) | |
download | nginx-d3fb12d77fad66eba2d8db102e505000c2a80e6d.tar.gz nginx-d3fb12d77fad66eba2d8db102e505000c2a80e6d.zip |
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.
-rw-r--r-- | src/event/quic/ngx_event_quic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/event/quic/ngx_event_quic.c b/src/event/quic/ngx_event_quic.c index a1abd267d..59f14b9e5 100644 --- a/src/event/quic/ngx_event_quic.c +++ b/src/event/quic/ngx_event_quic.c @@ -73,7 +73,7 @@ ngx_quic_connstate_dbg(ngx_connection_t *c) if (qc) { - if (qc->error) { + if (qc->error != (ngx_uint_t) -1) { p = ngx_slprintf(p, last, "%s", qc->error_app ? " app" : ""); p = ngx_slprintf(p, last, " error:%ui", qc->error); @@ -523,7 +523,7 @@ ngx_quic_close_connection(ngx_connection_t *c, ngx_int_t rc) qc->error = NGX_QUIC_ERR_NO_ERROR; } else { - if (qc->error == 0 && !qc->error_app) { + if (qc->error == (ngx_uint_t) -1 && !qc->error_app) { qc->error = NGX_QUIC_ERR_INTERNAL_ERROR; } @@ -939,7 +939,7 @@ ngx_quic_handle_payload(ngx_connection_t *c, ngx_quic_header_t *pkt) qc = ngx_quic_get_connection(c); - qc->error = 0; + qc->error = (ngx_uint_t) -1; qc->error_reason = 0; c->log->action = "decrypting packet"; |