Mercurial > hg > nginx
comparison src/http/v3/ngx_http_v3_filter_module.c @ 8818:07f90cb79fec quic
HTTP/3: use request pool instead of connection pool.
In several parts of ngx_http_v3_header_filter() connection pool was used for
request-related data.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Fri, 16 Jul 2021 15:43:01 +0300 |
parents | 8e8cdb7bfb17 |
children | 2cb697e7d77f |
comparison
equal
deleted
inserted
replaced
8817:8e8cdb7bfb17 | 8818:07f90cb79fec |
---|---|
481 | 481 |
482 if (r->header_only) { | 482 if (r->header_only) { |
483 b->last_buf = 1; | 483 b->last_buf = 1; |
484 } | 484 } |
485 | 485 |
486 cl = ngx_alloc_chain_link(c->pool); | 486 cl = ngx_alloc_chain_link(r->pool); |
487 if (cl == NULL) { | 487 if (cl == NULL) { |
488 return NGX_ERROR; | 488 return NGX_ERROR; |
489 } | 489 } |
490 | 490 |
491 cl->buf = b; | 491 cl->buf = b; |
494 n = b->last - b->pos; | 494 n = b->last - b->pos; |
495 | 495 |
496 len = ngx_http_v3_encode_varlen_int(NULL, NGX_HTTP_V3_FRAME_HEADERS) | 496 len = ngx_http_v3_encode_varlen_int(NULL, NGX_HTTP_V3_FRAME_HEADERS) |
497 + ngx_http_v3_encode_varlen_int(NULL, n); | 497 + ngx_http_v3_encode_varlen_int(NULL, n); |
498 | 498 |
499 b = ngx_create_temp_buf(c->pool, len); | 499 b = ngx_create_temp_buf(r->pool, len); |
500 if (b == NULL) { | 500 if (b == NULL) { |
501 return NGX_ERROR; | 501 return NGX_ERROR; |
502 } | 502 } |
503 | 503 |
504 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, | 504 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, |
505 NGX_HTTP_V3_FRAME_HEADERS); | 505 NGX_HTTP_V3_FRAME_HEADERS); |
506 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, n); | 506 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, n); |
507 | 507 |
508 hl = ngx_alloc_chain_link(c->pool); | 508 hl = ngx_alloc_chain_link(r->pool); |
509 if (hl == NULL) { | 509 if (hl == NULL) { |
510 return NGX_ERROR; | 510 return NGX_ERROR; |
511 } | 511 } |
512 | 512 |
513 hl->buf = b; | 513 hl->buf = b; |
521 { | 521 { |
522 len = ngx_http_v3_encode_varlen_int(NULL, NGX_HTTP_V3_FRAME_DATA) | 522 len = ngx_http_v3_encode_varlen_int(NULL, NGX_HTTP_V3_FRAME_DATA) |
523 + ngx_http_v3_encode_varlen_int(NULL, | 523 + ngx_http_v3_encode_varlen_int(NULL, |
524 r->headers_out.content_length_n); | 524 r->headers_out.content_length_n); |
525 | 525 |
526 b = ngx_create_temp_buf(c->pool, len); | 526 b = ngx_create_temp_buf(r->pool, len); |
527 if (b == NULL) { | 527 if (b == NULL) { |
528 return NGX_ERROR; | 528 return NGX_ERROR; |
529 } | 529 } |
530 | 530 |
531 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, | 531 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, |
532 NGX_HTTP_V3_FRAME_DATA); | 532 NGX_HTTP_V3_FRAME_DATA); |
533 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, | 533 b->last = (u_char *) ngx_http_v3_encode_varlen_int(b->last, |
534 r->headers_out.content_length_n); | 534 r->headers_out.content_length_n); |
535 | 535 |
536 cl = ngx_alloc_chain_link(c->pool); | 536 cl = ngx_alloc_chain_link(r->pool); |
537 if (cl == NULL) { | 537 if (cl == NULL) { |
538 return NGX_ERROR; | 538 return NGX_ERROR; |
539 } | 539 } |
540 | 540 |
541 cl->buf = b; | 541 cl->buf = b; |