@@ -1672,7 +1672,7 @@ static u32
16721672http3_stream_transport_rx_unknown_type (http3_stream_ctx_t * sctx ,
16731673 http_conn_t * stream )
16741674{
1675- u32 max_deq , to_deq ;
1675+ u32 max_deq , to_deq , n_deq ;
16761676 u8 * rx_buf , * p ;
16771677 u64 stream_type ;
16781678 http3_conn_ctx_t * h3c ;
@@ -1689,7 +1689,8 @@ http3_stream_transport_rx_unknown_type (http3_stream_ctx_t *sctx,
16891689 http3_stream_error_terminate_conn (stream , sctx , HTTP3_ERROR_GENERAL_PROTOCOL_ERROR );
16901690 return 0 ;
16911691 }
1692- http_io_ts_drain (stream , p - rx_buf );
1692+ n_deq = p - rx_buf ;
1693+ http_io_ts_drain (stream , n_deq );
16931694 sctx -> stream_type = stream_type ;
16941695 HTTP_DBG (1 , "stream type %lx [%u]%x sctx %x" , stream_type ,
16951696 stream -> hc_hc_index , sctx -> base .c_thread_index ,
@@ -1704,7 +1705,7 @@ http3_stream_transport_rx_unknown_type (http3_stream_ctx_t *sctx,
17041705 {
17051706 HTTP_DBG (1 , "second control stream opened" );
17061707 http3_stream_error_terminate_conn (stream , sctx , HTTP3_ERROR_STREAM_CREATION_ERROR );
1707- return 1 ;
1708+ return n_deq ;
17081709 }
17091710 h3c -> peer_ctrl_stream_sctx_index =
17101711 ((http_req_handle_t ) sctx -> base .hr_req_handle ).req_index ;
@@ -1715,7 +1716,7 @@ http3_stream_transport_rx_unknown_type (http3_stream_ctx_t *sctx,
17151716 {
17161717 HTTP_DBG (1 , "second decoder stream opened" );
17171718 http3_stream_error_terminate_conn (stream , sctx , HTTP3_ERROR_STREAM_CREATION_ERROR );
1718- return 1 ;
1719+ return n_deq ;
17191720 }
17201721 h3c -> peer_decoder_stream_sctx_index =
17211722 ((http_req_handle_t ) sctx -> base .hr_req_handle ).req_index ;
@@ -1726,7 +1727,7 @@ http3_stream_transport_rx_unknown_type (http3_stream_ctx_t *sctx,
17261727 {
17271728 HTTP_DBG (1 , "second encoder stream opened" );
17281729 http3_stream_error_terminate_conn (stream , sctx , HTTP3_ERROR_STREAM_CREATION_ERROR );
1729- return 1 ;
1730+ return n_deq ;
17301731 }
17311732 h3c -> peer_encoder_stream_sctx_index =
17321733 ((http_req_handle_t ) sctx -> base .hr_req_handle ).req_index ;
@@ -1737,18 +1738,19 @@ http3_stream_transport_rx_unknown_type (http3_stream_ctx_t *sctx,
17371738 {
17381739 HTTP_DBG (1 , "client initiated push stream" );
17391740 http3_stream_error_terminate_conn (stream , sctx , HTTP3_ERROR_STREAM_CREATION_ERROR );
1740- return 1 ;
1741+ return n_deq ;
17411742 }
17421743 /* push not supported (we do not send MAX_PUSH_ID frame)*/
17431744 HTTP_DBG (1 , "server initiated push stream, not supported" );
17441745 http3_stream_error_terminate_conn (stream , sctx , HTTP3_ERROR_ID_ERROR );
1745- return 1 ;
1746+ return n_deq ;
17461747 default :
17471748 sctx -> transport_rx_cb = http3_stream_transport_rx_drain ;
17481749 break ;
17491750 }
17501751
1751- return sctx -> transport_rx_cb (sctx , stream );
1752+ n_deq += sctx -> transport_rx_cb (sctx , stream );
1753+ return n_deq ;
17521754}
17531755
17541756static u32
0 commit comments