forked from wolfSSL/wolfssl
Group Early Data message with ClientHello for faster delivery
This commit is contained in:
@@ -14739,6 +14739,7 @@ int SendData(WOLFSSL* ssl, const void* data, int sz)
|
|||||||
sendSz,
|
sendSz,
|
||||||
ret,
|
ret,
|
||||||
dtlsExtra = 0;
|
dtlsExtra = 0;
|
||||||
|
int groupMsgs = 0;
|
||||||
|
|
||||||
if (ssl->error == WANT_WRITE
|
if (ssl->error == WANT_WRITE
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#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");
|
WOLFSSL_MSG("handshake complete, trying to send early data");
|
||||||
return BUILD_MSG_ERROR;
|
return BUILD_MSG_ERROR;
|
||||||
}
|
}
|
||||||
|
groupMsgs = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#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 */
|
/* 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");
|
WOLFSSL_MSG("output buffer was full, trying to send again");
|
||||||
if ( (ssl->error = SendBuffered(ssl)) < 0) {
|
if ( (ssl->error = SendBuffered(ssl)) < 0) {
|
||||||
WOLFSSL_ERROR(ssl->error);
|
WOLFSSL_ERROR(ssl->error);
|
||||||
|
@@ -2670,8 +2670,12 @@ int SendTls13ClientHello(WOLFSSL* ssl)
|
|||||||
|
|
||||||
ssl->buffers.outputBuffer.length += sendSz;
|
ssl->buffers.outputBuffer.length += sendSz;
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_EARLY_DATA
|
||||||
|
if (ssl->earlyData == no_early_data)
|
||||||
|
#endif
|
||||||
ret = SendBuffered(ssl);
|
ret = SendBuffered(ssl);
|
||||||
|
|
||||||
|
|
||||||
WOLFSSL_LEAVE("SendTls13ClientHello", ret);
|
WOLFSSL_LEAVE("SendTls13ClientHello", ret);
|
||||||
WOLFSSL_END(WC_FUNC_CLIENT_HELLO_SEND);
|
WOLFSSL_END(WC_FUNC_CLIENT_HELLO_SEND);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user