comparison src/event/ngx_event_quic.c @ 7711:a14afe21e692 quic

Double MAX_STREAMS on STREAMS_BLOCKED.
author Roman Arutyunyan <arut@nginx.com>
date Fri, 20 Mar 2020 10:14:58 +0300
parents db745339e54b
children 0d9bc77ae30d
comparison
equal deleted inserted replaced
7710:d60205f37f5a 7711:a14afe21e692
86 ngx_quic_header_t *pkt, ngx_quic_ack_frame_t *f); 86 ngx_quic_header_t *pkt, ngx_quic_ack_frame_t *f);
87 static ngx_int_t ngx_quic_handle_crypto_frame(ngx_connection_t *c, 87 static ngx_int_t ngx_quic_handle_crypto_frame(ngx_connection_t *c,
88 ngx_quic_header_t *pkt, ngx_quic_crypto_frame_t *frame); 88 ngx_quic_header_t *pkt, ngx_quic_crypto_frame_t *frame);
89 static ngx_int_t ngx_quic_handle_stream_frame(ngx_connection_t *c, 89 static ngx_int_t ngx_quic_handle_stream_frame(ngx_connection_t *c,
90 ngx_quic_header_t *pkt, ngx_quic_stream_frame_t *frame); 90 ngx_quic_header_t *pkt, ngx_quic_stream_frame_t *frame);
91 static ngx_int_t ngx_quic_handle_streams_blocked_frame(ngx_connection_t *c,
92 ngx_quic_header_t *pkt, ngx_quic_streams_blocked_frame_t *f);
91 93
92 static void ngx_quic_queue_frame(ngx_quic_connection_t *qc, 94 static void ngx_quic_queue_frame(ngx_quic_connection_t *qc,
93 ngx_quic_frame_t *frame); 95 ngx_quic_frame_t *frame);
94 96
95 static ngx_int_t ngx_quic_output(ngx_connection_t *c); 97 static ngx_int_t ngx_quic_output(ngx_connection_t *c);
795 /* TODO: handle; need ack ? */ 797 /* TODO: handle; need ack ? */
796 break; 798 break;
797 799
798 case NGX_QUIC_FT_STREAMS_BLOCKED: 800 case NGX_QUIC_FT_STREAMS_BLOCKED:
799 case NGX_QUIC_FT_STREAMS_BLOCKED2: 801 case NGX_QUIC_FT_STREAMS_BLOCKED2:
800 /* TODO: handle; need ack ? */ 802
803 if (ngx_quic_handle_streams_blocked_frame(c, pkt,
804 &frame.u.streams_blocked)
805 != NGX_OK)
806 {
807 return NGX_ERROR;
808 }
809
810 ack_this = 1;
801 break; 811 break;
802 812
803 default: 813 default:
804 return NGX_ERROR; 814 return NGX_ERROR;
805 } 815 }
945 955
946 ngx_memcpy(b->start, f->data, f->length); 956 ngx_memcpy(b->start, f->data, f->length);
947 b->last = b->start + f->length; 957 b->last = b->start + f->length;
948 958
949 qc->streams.handler(sn->c); 959 qc->streams.handler(sn->c);
960
961 return NGX_OK;
962 }
963
964
965 static ngx_int_t
966 ngx_quic_handle_streams_blocked_frame(ngx_connection_t *c,
967 ngx_quic_header_t *pkt, ngx_quic_streams_blocked_frame_t *f)
968 {
969 ngx_quic_frame_t *frame;
970
971 frame = ngx_pcalloc(c->pool, sizeof(ngx_quic_frame_t));
972 if (frame == NULL) {
973 return NGX_ERROR;
974 }
975
976 frame->level = pkt->level;
977 frame->type = NGX_QUIC_FT_MAX_STREAMS;
978 frame->u.max_streams.limit = f->limit * 2;
979 frame->u.max_streams.bidi = f->bidi;
980
981 ngx_sprintf(frame->info, "MAX_STREAMS limit:%d bidi:%d level=%d",
982 (int) frame->u.max_streams.limit,
983 (int) frame->u.max_streams.bidi,
984 frame->level);
985
986 ngx_quic_queue_frame(c->quic, frame);
950 987
951 return NGX_OK; 988 return NGX_OK;
952 } 989 }
953 990
954 991