Mercurial > hg > nginx
changeset 8342:76e8ec502c69 quic
Fixed error descriptions.
The check for array bound is done inside function that returns error
description. Missing initialization element is added.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Thu, 16 Apr 2020 16:54:22 +0300 |
parents | efc0a65424e8 |
children | de715cdd4257 |
files | src/event/ngx_event_quic_transport.c src/event/ngx_event_quic_transport.h |
diffstat | 2 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/ngx_event_quic_transport.c Thu Apr 16 13:28:43 2020 +0300 +++ b/src/event/ngx_event_quic_transport.c Thu Apr 16 16:54:22 2020 +0300 @@ -99,9 +99,10 @@ "CONNECTION_ID_LIMIT_ERROR", "PROTOCOL_VIOLATION", "INVALID_TOKEN", - "", + "unknown error 0xC", "CRYPTO_BUFFER_EXCEEDED", - "", + "unknown error 0xE", + "unknown error 0xF", "CRYPTO_ERROR", }; @@ -266,6 +267,11 @@ u_char * ngx_quic_error_text(uint64_t error_code) { + + if (error_code >= NGX_QUIC_ERR_LAST) { + return (u_char *) "unknown error"; + } + return (u_char *) ngx_quic_errors[error_code]; } @@ -777,13 +783,6 @@ if (f->type == NGX_QUIC_FT_CONNECTION_CLOSE) { - if (f->u.close.error_code >= NGX_QUIC_ERR_LAST) { - ngx_log_error(NGX_LOG_INFO, pkt->log, 0, - "unkown error code: %ui, truncated", - f->u.close.error_code); - f->u.close.error_code = NGX_QUIC_ERR_LAST - 1; - } - ngx_log_debug4(NGX_LOG_DEBUG_EVENT, pkt->log, 0, "CONN.CLOSE: { %s (0x%xi) type=0x%xi reason='%V'}", ngx_quic_error_text(f->u.close.error_code),
--- a/src/event/ngx_event_quic_transport.h Thu Apr 16 13:28:43 2020 +0300 +++ b/src/event/ngx_event_quic_transport.h Thu Apr 16 16:54:22 2020 +0300 @@ -75,6 +75,7 @@ /* 0xC is not defined */ #define NGX_QUIC_ERR_CRYPTO_BUFFER_EXCEEDED 0x0D /* 0xE is not defined */ +/* 0xF is not defined */ #define NGX_QUIC_ERR_CRYPTO_ERROR 0x10 #define NGX_QUIC_ERR_LAST NGX_QUIC_ERR_CRYPTO_ERROR