forked from wolfSSL/wolfssl
DTLS Nonblocking Updates
Modify the DtlsMsgPoolSend() function to keep track of the last message retransmit. If a write would block, it allows the retransmit pick up where it left off.
This commit is contained in:
@@ -6057,6 +6057,7 @@ void DtlsMsgPoolReset(WOLFSSL* ssl)
|
|||||||
if (ssl->dtls_tx_msg_list) {
|
if (ssl->dtls_tx_msg_list) {
|
||||||
DtlsMsgListDelete(ssl->dtls_tx_msg_list, ssl->heap);
|
DtlsMsgListDelete(ssl->dtls_tx_msg_list, ssl->heap);
|
||||||
ssl->dtls_tx_msg_list = NULL;
|
ssl->dtls_tx_msg_list = NULL;
|
||||||
|
ssl->dtls_tx_msg = NULL;
|
||||||
ssl->dtls_tx_msg_list_sz = 0;
|
ssl->dtls_tx_msg_list_sz = 0;
|
||||||
ssl->dtls_timeout = ssl->dtls_timeout_init;
|
ssl->dtls_timeout = ssl->dtls_timeout_init;
|
||||||
}
|
}
|
||||||
@@ -6085,10 +6086,12 @@ int VerifyForDtlsMsgPoolSend(WOLFSSL* ssl, byte type, word32 fragOffset)
|
|||||||
int DtlsMsgPoolSend(WOLFSSL* ssl, int sendOnlyFirstPacket)
|
int DtlsMsgPoolSend(WOLFSSL* ssl, int sendOnlyFirstPacket)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
DtlsMsg* pool = ssl->dtls_tx_msg_list;
|
DtlsMsg* pool;
|
||||||
|
|
||||||
WOLFSSL_ENTER("DtlsMsgPoolSend()");
|
WOLFSSL_ENTER("DtlsMsgPoolSend()");
|
||||||
|
|
||||||
|
pool = ssl->dtls_tx_msg == NULL ? ssl->dtls_tx_msg_list : ssl->dtls_tx_msg;
|
||||||
|
|
||||||
if (pool != NULL) {
|
if (pool != NULL) {
|
||||||
if ((ssl->options.side == WOLFSSL_SERVER_END &&
|
if ((ssl->options.side == WOLFSSL_SERVER_END &&
|
||||||
!(ssl->options.acceptState == SERVER_HELLO_DONE ||
|
!(ssl->options.acceptState == SERVER_HELLO_DONE ||
|
||||||
@@ -6176,6 +6179,7 @@ int DtlsMsgPoolSend(WOLFSSL* ssl, int sendOnlyFirstPacket)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
pool = pool->next;
|
pool = pool->next;
|
||||||
|
ssl->dtls_tx_msg = pool;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3741,6 +3741,7 @@ struct WOLFSSL {
|
|||||||
word32 dtls_tx_msg_list_sz;
|
word32 dtls_tx_msg_list_sz;
|
||||||
word32 dtls_rx_msg_list_sz;
|
word32 dtls_rx_msg_list_sz;
|
||||||
DtlsMsg* dtls_tx_msg_list;
|
DtlsMsg* dtls_tx_msg_list;
|
||||||
|
DtlsMsg* dtls_tx_msg;
|
||||||
DtlsMsg* dtls_rx_msg_list;
|
DtlsMsg* dtls_rx_msg_list;
|
||||||
void* IOCB_CookieCtx; /* gen cookie ctx */
|
void* IOCB_CookieCtx; /* gen cookie ctx */
|
||||||
word32 dtls_expected_rx;
|
word32 dtls_expected_rx;
|
||||||
|
Reference in New Issue
Block a user