comparison src/event/ngx_event_quic.c @ 7924:8fc9fcf18608 quic

Stream ID handling in MAX_STREAM_DATA and STREAM_DATA_BLOCKED.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 05 Jun 2020 20:59:27 +0300
parents 953cf44708b0
children 6fec79e43694
comparison
equal deleted inserted replaced
7923:953cf44708b0 7924:8fc9fcf18608
2873 ngx_quic_frame_t *frame; 2873 ngx_quic_frame_t *frame;
2874 ngx_quic_stream_t *sn; 2874 ngx_quic_stream_t *sn;
2875 ngx_quic_connection_t *qc; 2875 ngx_quic_connection_t *qc;
2876 2876
2877 qc = c->quic; 2877 qc = c->quic;
2878
2879 if ((f->id & NGX_QUIC_STREAM_UNIDIRECTIONAL)
2880 && (f->id & NGX_QUIC_STREAM_SERVER_INITIATED))
2881 {
2882 qc->error = NGX_QUIC_ERR_STREAM_STATE_ERROR;
2883 return NGX_ERROR;
2884 }
2885
2878 sn = ngx_quic_find_stream(&qc->streams.tree, f->id); 2886 sn = ngx_quic_find_stream(&qc->streams.tree, f->id);
2879 2887
2880 if (sn == NULL) { 2888 if (sn == NULL) {
2881 ngx_log_error(NGX_LOG_INFO, c->log, 0, 2889 ngx_log_error(NGX_LOG_INFO, c->log, 0,
2882 "quic unknown stream id:%uL", f->id); 2890 "quic unknown stream id:%uL", f->id);
2915 ngx_event_t *wev; 2923 ngx_event_t *wev;
2916 ngx_quic_stream_t *sn; 2924 ngx_quic_stream_t *sn;
2917 ngx_quic_connection_t *qc; 2925 ngx_quic_connection_t *qc;
2918 2926
2919 qc = c->quic; 2927 qc = c->quic;
2928
2929 if ((f->id & NGX_QUIC_STREAM_UNIDIRECTIONAL)
2930 && (f->id & NGX_QUIC_STREAM_SERVER_INITIATED) == 0)
2931 {
2932 qc->error = NGX_QUIC_ERR_STREAM_STATE_ERROR;
2933 return NGX_ERROR;
2934 }
2935
2920 sn = ngx_quic_find_stream(&qc->streams.tree, f->id); 2936 sn = ngx_quic_find_stream(&qc->streams.tree, f->id);
2921 2937
2922 if (sn == NULL) { 2938 if (sn == NULL) {
2923 ngx_log_error(NGX_LOG_INFO, c->log, 0, "unknown stream id:%uL", f->id); 2939 ngx_log_error(NGX_LOG_INFO, c->log, 0, "unknown stream id:%uL", f->id);
2940
2941 if (f->id & NGX_QUIC_STREAM_SERVER_INITIATED) {
2942 qc->error = NGX_QUIC_ERR_STREAM_STATE_ERROR;
2943 }
2944
2924 return NGX_ERROR; 2945 return NGX_ERROR;
2925 } 2946 }
2926 2947
2927 if (f->limit <= sn->send_max_data) { 2948 if (f->limit <= sn->send_max_data) {
2928 return NGX_OK; 2949 return NGX_OK;