1919#include <haproxy/quic_enc.h>
2020#include <haproxy/quic_fctl.h>
2121#include <haproxy/quic_frame.h>
22+ #include <haproxy/quic_pacing.h>
2223#include <haproxy/quic_sock.h>
2324#include <haproxy/quic_stream.h>
2425#include <haproxy/quic_tp-t.h>
@@ -2244,8 +2245,8 @@ static int qcs_send(struct qcs *qcs, struct list *frms, uint64_t window_conn)
22442245 */
22452246static int qcc_io_send (struct qcc * qcc )
22462247{
2247- struct list frms = LIST_HEAD_INIT (frms );
22482248 /* Temporary list for QCS on error. */
2249+ struct list * frms = quic_pacing_frms (& qcc -> tx .pacer );
22492250 struct list qcs_failed = LIST_HEAD_INIT (qcs_failed );
22502251 struct qcs * qcs , * qcs_tmp , * first_qcs = NULL ;
22512252 uint64_t window_conn = qfctl_rcap (& qcc -> tx .fc );
@@ -2338,7 +2339,7 @@ static int qcc_io_send(struct qcc *qcc)
23382339
23392340 if (!qfctl_rblocked (& qcc -> tx .fc ) &&
23402341 !qfctl_rblocked (& qcs -> tx .fc ) && window_conn > total ) {
2341- if ((ret = qcs_send (qcs , & frms , window_conn - total )) < 0 ) {
2342+ if ((ret = qcs_send (qcs , frms , window_conn - total )) < 0 ) {
23422343 /* Temporarily remove QCS from send-list. */
23432344 LIST_DEL_INIT (& qcs -> el_send );
23442345 LIST_APPEND (& qcs_failed , & qcs -> el_send );
@@ -2362,7 +2363,7 @@ static int qcc_io_send(struct qcc *qcc)
23622363 /* Retry sending until no frame to send, data rejected or connection
23632364 * flow-control limit reached.
23642365 */
2365- while (qcc_send_frames (qcc , & frms ) == 0 && !qfctl_rblocked (& qcc -> tx .fc )) {
2366+ while (( ret = qcc_send_frames (qcc , frms ) ) == 0 && !qfctl_rblocked (& qcc -> tx .fc )) {
23662367 window_conn = qfctl_rcap (& qcc -> tx .fc );
23672368 resent = 0 ;
23682369
@@ -2380,7 +2381,7 @@ static int qcc_io_send(struct qcc *qcc)
23802381 BUG_ON (resent > window_conn );
23812382
23822383 if (!qfctl_rblocked (& qcs -> tx .fc ) && window_conn > resent ) {
2383- if ((ret = qcs_send (qcs , & frms , window_conn - resent )) < 0 ) {
2384+ if ((ret = qcs_send (qcs , frms , window_conn - resent )) < 0 ) {
23842385 LIST_DEL_INIT (& qcs -> el_send );
23852386 LIST_APPEND (& qcs_failed , & qcs -> el_send );
23862387 continue ;
@@ -2394,12 +2395,7 @@ static int qcc_io_send(struct qcc *qcc)
23942395
23952396 sent_done :
23962397 /* Deallocate frames that the transport layer has rejected. */
2397- if (!LIST_ISEMPTY (& frms )) {
2398- struct quic_frame * frm , * frm2 ;
2399-
2400- list_for_each_entry_safe (frm , frm2 , & frms , list )
2401- qc_frm_free (qcc -> conn -> handle .qc , & frm );
2402- }
2398+ quic_pacing_reset (& qcc -> tx .pacer );
24032399
24042400 /* Re-insert on-error QCS at the end of the send-list. */
24052401 if (!LIST_ISEMPTY (& qcs_failed )) {
@@ -2719,6 +2715,8 @@ static void qcc_release(struct qcc *qcc)
27192715 qc_frm_free (qcc -> conn -> handle .qc , & frm );
27202716 }
27212717
2718+ quic_pacing_reset (& qcc -> tx .pacer );
2719+
27222720 if (qcc -> app_ops && qcc -> app_ops -> release )
27232721 qcc -> app_ops -> release (qcc -> ctx );
27242722 TRACE_PROTO ("application layer released" , QMUX_EV_QCC_END , conn );
0 commit comments