Mercurial > hg > nginx
diff src/http/v3/ngx_http_v3_parse.c @ 8467:e02250b55b17 quic
HTTP/3: simplified handling return codes from parse functions.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Thu, 02 Jul 2020 20:07:24 +0300 |
parents | 4fd709540daf |
children | d2f716e668e8 |
line wrap: on
line diff
--- a/src/http/v3/ngx_http_v3_parse.c Fri Jul 03 12:07:43 2020 +0300 +++ b/src/http/v3/ngx_http_v3_parse.c Thu Jul 02 20:07:24 2020 +0300 @@ -197,11 +197,6 @@ } rc = ngx_http_v3_parse_header_block_prefix(c, &st->prefix, ch); - - if (rc == NGX_AGAIN) { - break; - } - if (rc != NGX_DONE) { return rc; } @@ -228,14 +223,9 @@ rc = ngx_http_v3_parse_header_rep(c, &st->header_rep, st->prefix.base, ch); - st->length--; - if (rc == NGX_AGAIN) { - if (st->length == 0) { - return NGX_HTTP_V3_ERR_FRAME_ERROR; - } - - break; + if (--st->length == 0 && rc == NGX_AGAIN) { + return NGX_HTTP_V3_ERR_FRAME_ERROR; } if (rc != NGX_DONE) { @@ -1018,14 +1008,8 @@ rc = ngx_http_v3_parse_settings(c, &st->settings, ch); - st->length--; - - if (rc == NGX_AGAIN) { - if (st->length == 0) { - return NGX_HTTP_V3_ERR_SETTINGS_ERROR; - } - - break; + if (--st->length == 0 && rc == NGX_AGAIN) { + return NGX_HTTP_V3_ERR_SETTINGS_ERROR; } if (rc != NGX_DONE) { @@ -1167,11 +1151,6 @@ case sw_inr: rc = ngx_http_v3_parse_header_inr(c, &st->header, ch); - - if (rc == NGX_AGAIN) { - break; - } - if (rc != NGX_DONE) { return rc; } @@ -1181,11 +1160,6 @@ case sw_iwnr: rc = ngx_http_v3_parse_header_iwnr(c, &st->header, ch); - - if (rc == NGX_AGAIN) { - break; - } - if (rc != NGX_DONE) { return rc; }