comparison src/event/quic/ngx_event_quic_ack.c @ 8779:f52a2b77d406 quic

QUIC: generic buffering for stream input. Previously each stream had an input buffer. Now memory is allocated as bytes arrive. Generic buffering mechanism is used for this.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 05 May 2021 17:15:20 +0300
parents 4117aa7fa38e
children 004172345bdc
comparison
equal deleted inserted replaced
8778:5186ee5a94b9 8779:f52a2b77d406
430 430
431 431
432 void 432 void
433 ngx_quic_resend_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx) 433 ngx_quic_resend_frames(ngx_connection_t *c, ngx_quic_send_ctx_t *ctx)
434 { 434 {
435 size_t n;
436 ngx_buf_t *b;
437 ngx_queue_t *q; 435 ngx_queue_t *q;
438 ngx_quic_frame_t *f, *start; 436 ngx_quic_frame_t *f, *start;
439 ngx_quic_stream_t *qs; 437 ngx_quic_stream_t *qs;
440 ngx_quic_connection_t *qc; 438 ngx_quic_connection_t *qc;
441 439
495 if (qs == NULL) { 493 if (qs == NULL) {
496 ngx_quic_free_frame(c, f); 494 ngx_quic_free_frame(c, f);
497 break; 495 break;
498 } 496 }
499 497
500 b = qs->b; 498 f->u.max_stream_data.limit = qs->recv_max_data;
501 n = qs->fs->received + (b->pos - b->start) + (b->end - b->last);
502
503 if (f->u.max_stream_data.limit < n) {
504 f->u.max_stream_data.limit = n;
505 }
506
507 ngx_quic_queue_frame(qc, f); 499 ngx_quic_queue_frame(qc, f);
508 break; 500 break;
509 501
510 case NGX_QUIC_FT_STREAM0: 502 case NGX_QUIC_FT_STREAM0:
511 case NGX_QUIC_FT_STREAM1: 503 case NGX_QUIC_FT_STREAM1: