aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/quic/quic.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/quic/quic.c')
-rw-r--r--src/plugins/quic/quic.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/quic/quic.c b/src/plugins/quic/quic.c
index dc3b1d4038e..fd848b07331 100644
--- a/src/plugins/quic/quic.c
+++ b/src/plugins/quic/quic.c
@@ -2153,7 +2153,7 @@ static int
quic_udp_session_rx_callback (session_t * udp_session)
{
/* Read data from UDP rx_fifo and pass it to the quicly conn. */
- quic_ctx_t *ctx = NULL;
+ quic_ctx_t *ctx = NULL, *prev_ctx = NULL;
svm_fifo_t *f = udp_session->rx_fifo;
u32 max_deq;
u64 udp_session_handle = session_handle (udp_session);
@@ -2234,8 +2234,10 @@ rx_start:
break;
}
}
+ ctx = prev_ctx = NULL;
for (i = 0; i < max_packets; i++)
{
+ prev_ctx = ctx;
switch (packets_ctx[i].ptype)
{
case QUIC_PACKET_TYPE_RECEIVE:
@@ -2250,9 +2252,11 @@ rx_start:
packets_ctx[i].thread_index);
break;
default:
- continue;
+ continue; /* this exits the for loop since other packet types are
+ necessarily the last in the batch */
}
- quic_send_packets (ctx);
+ if (ctx != prev_ctx)
+ quic_send_packets (ctx);
}
udp_session = session_get_from_handle (udp_session_handle); /* session alloc might have happened */