From 471a9bd9fd98490d4489325f6b2d02bfc2cb11b4 Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Wed, 24 Jun 2020 11:42:56 +0200 Subject: [PATCH] Handle 2+ dtls APP data records in one udp packet Just return one message at a time if processing application data --- src/internal.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/internal.c b/src/internal.c index e9a888bb1..e5d69567f 100644 --- a/src/internal.c +++ b/src/internal.c @@ -15609,8 +15609,14 @@ int ProcessReply(WOLFSSL* ssl) ssl->options.processReply = doProcessInit; - /* input exhausted? */ - if (ssl->buffers.inputBuffer.idx >= ssl->buffers.inputBuffer.length) + /* input exhausted */ + if (ssl->buffers.inputBuffer.idx >= ssl->buffers.inputBuffer.length +#ifdef WOLFSSL_DTLS + /* If app data was processed then return now to avoid + * dropping any app data. */ + || (ssl->options.dtls && ssl->curRL.type == application_data) +#endif + ) return ret; /* more messages per record */