diff --git a/src/internal.c b/src/internal.c index e62a43221..83515dbe2 100644 --- a/src/internal.c +++ b/src/internal.c @@ -14739,6 +14739,7 @@ int SendData(WOLFSSL* ssl, const void* data, int sz) sendSz, ret, dtlsExtra = 0; + int groupMsgs = 0; if (ssl->error == WANT_WRITE #ifdef WOLFSSL_ASYNC_CRYPT @@ -14763,6 +14764,7 @@ int SendData(WOLFSSL* ssl, const void* data, int sz) WOLFSSL_MSG("handshake complete, trying to send early data"); return BUILD_MSG_ERROR; } + groupMsgs = 1; } else #endif @@ -14781,7 +14783,7 @@ int SendData(WOLFSSL* ssl, const void* data, int sz) } /* last time system socket output buffer was full, try again to send */ - if (ssl->buffers.outputBuffer.length > 0) { + if (!groupMsgs && ssl->buffers.outputBuffer.length > 0) { WOLFSSL_MSG("output buffer was full, trying to send again"); if ( (ssl->error = SendBuffered(ssl)) < 0) { WOLFSSL_ERROR(ssl->error); diff --git a/src/tls13.c b/src/tls13.c index 37963a453..fa437b3d2 100644 --- a/src/tls13.c +++ b/src/tls13.c @@ -2670,7 +2670,11 @@ int SendTls13ClientHello(WOLFSSL* ssl) ssl->buffers.outputBuffer.length += sendSz; - ret = SendBuffered(ssl); +#ifdef WOLFSSL_EARLY_DATA + if (ssl->earlyData == no_early_data) +#endif + ret = SendBuffered(ssl); + WOLFSSL_LEAVE("SendTls13ClientHello", ret); WOLFSSL_END(WC_FUNC_CLIENT_HELLO_SEND);