comparison src/event/ngx_event_quic.c @ 8158:c01964fd7b8b quic

QUIC: fixed dropping output ack ranges on input ack. While there, additional debug messages were added.
author Vladimir Homutov <vl@nginx.com>
date Wed, 21 Oct 2020 20:39:25 +0300
parents 85a550047eb5
children 06af25901b1a
comparison
equal deleted inserted replaced
8157:85a550047eb5 8158:c01964fd7b8b
2307 2307
2308 c->log->action = "preparing ack"; 2308 c->log->action = "preparing ack";
2309 2309
2310 ctx = ngx_quic_get_send_ctx(c->quic, pkt->level); 2310 ctx = ngx_quic_get_send_ctx(c->quic, pkt->level);
2311 2311
2312 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, 2312 ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,
2313 "ngx_quic_ack_packet pn %uL largest %uL nranges %ui", 2313 "ngx_quic_ack_packet pn %uL largest %uL"
2314 pkt->pn, ctx->largest_range, ctx->nranges); 2314 " first %uL nranges %ui", pkt->pn, ctx->largest_range,
2315 ctx->first_range, ctx->nranges);
2315 2316
2316 prev_pending = ctx->pending_ack; 2317 prev_pending = ctx->pending_ack;
2317 2318
2318 if (pkt->need_ack) { 2319 if (pkt->need_ack) {
2319 2320
2546 uint64_t pn) 2547 uint64_t pn)
2547 { 2548 {
2548 uint64_t base; 2549 uint64_t base;
2549 ngx_uint_t i, smallest, largest; 2550 ngx_uint_t i, smallest, largest;
2550 ngx_quic_ack_range_t *r; 2551 ngx_quic_ack_range_t *r;
2552
2553 ngx_log_debug4(NGX_LOG_DEBUG_EVENT, c->log, 0,
2554 "ngx_quic_drop_ack_ranges pn %uL largest %uL"
2555 " first %uL nranges %ui", pn, ctx->largest_range,
2556 ctx->first_range, ctx->nranges);
2551 2557
2552 base = ctx->largest_range; 2558 base = ctx->largest_range;
2553 2559
2554 if (base == NGX_QUIC_UNSET_PN) { 2560 if (base == NGX_QUIC_UNSET_PN) {
2555 return; 2561 return;
2791 if (send_time != NGX_TIMER_INFINITE) { 2797 if (send_time != NGX_TIMER_INFINITE) {
2792 ngx_quic_rtt_sample(c, ack, pkt->level, send_time); 2798 ngx_quic_rtt_sample(c, ack, pkt->level, send_time);
2793 } 2799 }
2794 } 2800 }
2795 2801
2802 ngx_quic_drop_ack_ranges(c, ctx, ack->largest);
2803
2796 pos = ack->ranges_start; 2804 pos = ack->ranges_start;
2797 end = ack->ranges_end; 2805 end = ack->ranges_end;
2798 2806
2799 for (i = 0; i < ack->range_count; i++) { 2807 for (i = 0; i < ack->range_count; i++) {
2800 2808
2861 2869
2862 if (f->pnum >= min && f->pnum <= max) { 2870 if (f->pnum >= min && f->pnum <= max) {
2863 ngx_quic_congestion_ack(c, f); 2871 ngx_quic_congestion_ack(c, f);
2864 2872
2865 switch (f->type) { 2873 switch (f->type) {
2866 case NGX_QUIC_FT_ACK:
2867 ngx_quic_drop_ack_ranges(c, ctx, f->u.ack.largest);
2868 break;
2869 2874
2870 case NGX_QUIC_FT_STREAM0: 2875 case NGX_QUIC_FT_STREAM0:
2871 case NGX_QUIC_FT_STREAM1: 2876 case NGX_QUIC_FT_STREAM1:
2872 case NGX_QUIC_FT_STREAM2: 2877 case NGX_QUIC_FT_STREAM2:
2873 case NGX_QUIC_FT_STREAM3: 2878 case NGX_QUIC_FT_STREAM3: