Address code review

- Use functions instead of accessing `BIO` members
- Add `wolfSSL_BIO_method_type`
This commit is contained in:
Juliusz Sosinowicz
2022-03-02 16:11:07 +01:00
parent a104cf887e
commit c7c3ee00bb
5 changed files with 12 additions and 5 deletions

View File

@@ -170,8 +170,8 @@ int BioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx)
recvd = wolfSSL_BIO_read(ssl->biord, buf, sz);
if (recvd <= 0) {
if (/* ssl->biowr->wrIdx is checked for Bind9 */
ssl->biowr != NULL && ssl->biowr->type == WOLFSSL_BIO_BIO &&
ssl->biowr->wrIdx != 0 &&
wolfSSL_BIO_method_type(ssl->biowr) == WOLFSSL_BIO_BIO &&
wolfSSL_BIO_wpending(ssl->biowr) != 0 &&
/* Not sure this pending check is necessary but let's double
* check that the read BIO is empty before we signal a write
* need */