comparison src/http/v3/ngx_http_v3_request.c @ 8460:72f9ff4e0a88 quic

HTTP/3: close QUIC connection with HTTP/QPACK errors when needed. Previously errors led only to closing streams. To simplify closing QUIC connection from a QUIC stream context, new macro ngx_http_v3_finalize_connection() is introduced. It calls ngx_quic_finalize_connection() for the parent connection.
author Roman Arutyunyan <arut@nginx.com>
date Thu, 02 Jul 2020 16:47:51 +0300
parents c9538aef3211
children 79125ef2e39f
comparison
equal deleted inserted replaced
8459:1ed698947172 8460:72f9ff4e0a88
64 } 64 }
65 65
66 while (b->pos < b->last) { 66 while (b->pos < b->last) {
67 rc = ngx_http_v3_parse_headers(c, st, *b->pos); 67 rc = ngx_http_v3_parse_headers(c, st, *b->pos);
68 68
69 if (rc > 0) {
70 ngx_http_v3_finalize_connection(c, rc,
71 "could not parse request headers");
72 goto failed;
73 }
74
69 if (rc == NGX_ERROR) { 75 if (rc == NGX_ERROR) {
70 goto failed; 76 goto failed;
71 } 77 }
72 78
73 if (rc == NGX_BUSY) { 79 if (rc == NGX_BUSY) {
178 } 184 }
179 185
180 while (b->pos < b->last) { 186 while (b->pos < b->last) {
181 rc = ngx_http_v3_parse_headers(c, st, *b->pos++); 187 rc = ngx_http_v3_parse_headers(c, st, *b->pos++);
182 188
189 if (rc > 0) {
190 ngx_http_v3_finalize_connection(c, rc,
191 "could not parse request headers");
192 return NGX_HTTP_PARSE_INVALID_HEADER;
193 }
194
183 if (rc == NGX_ERROR) { 195 if (rc == NGX_ERROR) {
184 return NGX_HTTP_PARSE_INVALID_HEADER; 196 return NGX_HTTP_PARSE_INVALID_HEADER;
185 } 197 }
186 198
187 if (rc == NGX_DONE) { 199 if (rc == NGX_DONE) {
356 return (b->pos == b->last) ? NGX_AGAIN : NGX_OK; 368 return (b->pos == b->last) ? NGX_AGAIN : NGX_OK;
357 } 369 }
358 370
359 while (b->pos < b->last) { 371 while (b->pos < b->last) {
360 rc = ngx_http_v3_parse_data(c, st, *b->pos++); 372 rc = ngx_http_v3_parse_data(c, st, *b->pos++);
373
374 if (rc > 0) {
375 ngx_http_v3_finalize_connection(c, rc,
376 "could not parse request body");
377 goto failed;
378 }
361 379
362 if (rc == NGX_ERROR) { 380 if (rc == NGX_ERROR) {
363 goto failed; 381 goto failed;
364 } 382 }
365 383