Mercurial > hg > nginx
changeset 8994:e00295b76395 quic
QUIC: revised ngx_quic_handle_datagram() error codes.
The NGX_DECLINED is replaced with NGX_DONE to match closer to return code
of ngx_quic_handle_packet() and ngx_quic_close_connection() rc argument.
The ngx_quic_close_connection() rc code is used only when quic connection
exists, thus anything goes if qc == NULL.
The ngx_quic_handle_datagram() does not return NG_OK in cases when quic
connection is not yet created.
author | Vladimir Homutov <vl@nginx.com> |
---|---|
date | Tue, 01 Feb 2022 14:35:31 +0300 |
parents | 7626aa7a2156 |
children | 19251fb83187 |
files | src/event/quic/ngx_event_quic.c src/event/quic/ngx_event_quic_output.c |
diffstat | 2 files changed, 7 insertions(+), 16 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/quic/ngx_event_quic.c Wed Jan 26 12:01:31 2022 +0300 +++ b/src/event/quic/ngx_event_quic.c Tue Feb 01 14:35:31 2022 +0300 @@ -210,17 +210,13 @@ rc = ngx_quic_handle_datagram(c, c->buffer, conf); if (rc != NGX_OK) { - ngx_quic_close_connection(c, rc == NGX_DECLINED ? NGX_DONE : NGX_ERROR); + ngx_quic_close_connection(c, rc); return; } + /* quic connection is now created */ qc = ngx_quic_get_connection(c); - if (qc == NULL) { - ngx_quic_close_connection(c, NGX_DONE); - return; - } - ngx_add_timer(c->read, qc->tp.max_idle_timeout); ngx_quic_connstate_dbg(c); @@ -443,7 +439,7 @@ return; } - if (rc == NGX_DECLINED) { + if (rc == NGX_DONE) { return; } @@ -709,13 +705,8 @@ } #endif - if (rc == NGX_ERROR) { - return NGX_ERROR; - } - - if (rc == NGX_DONE) { - /* stop further processing */ - return NGX_DECLINED; + if (rc == NGX_ERROR || rc == NGX_DONE) { + return rc; } if (rc == NGX_OK) { @@ -750,7 +741,7 @@ } if (!good) { - return NGX_DECLINED; + return NGX_DONE; } qc = ngx_quic_get_connection(c);