mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
internal: return from wolfSSL_Peek() with sz 0 if we don't have data
This way we can use wolfSSL_Peek() invoked with sz == 0 to process pending records and, if none of this records is an application data record, we will not block.
This commit is contained in:
committed by
David Garske
parent
dfc9873c0f
commit
e2abdf23a7
@ -21193,6 +21193,17 @@ startScr:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_DTLS13
|
||||||
|
/* if wolfSSL_Peek() is invoked with sz == 0 it will not block (but
|
||||||
|
* it processes pending non-application records) */
|
||||||
|
if (ssl->options.dtls && IsAtLeastTLSv1_3(ssl->version) && peek &&
|
||||||
|
sz == 0 && ssl->buffers.inputBuffer.idx
|
||||||
|
- ssl->buffers.inputBuffer.length == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif /* WOLFSSL_DTLS13 */
|
||||||
|
|
||||||
#ifndef WOLFSSL_TLS13_NO_PEEK_HANDSHAKE_DONE
|
#ifndef WOLFSSL_TLS13_NO_PEEK_HANDSHAKE_DONE
|
||||||
#ifdef WOLFSSL_TLS13
|
#ifdef WOLFSSL_TLS13
|
||||||
if (IsAtLeastTLSv1_3(ssl->version) && ssl->options.handShakeDone &&
|
if (IsAtLeastTLSv1_3(ssl->version) && ssl->options.handShakeDone &&
|
||||||
|
Reference in New Issue
Block a user