forked from wolfSSL/wolfssl
Handle the BIO want read in BioReceive.
This commit is contained in:
@ -264,12 +264,6 @@ int wolfSSL_BIO_read(WOLFSSL_BIO* bio, void* buf, int len)
|
|||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
sz = ret; /* adjust size for formatting */
|
sz = ret; /* adjust size for formatting */
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (wolfSSL_BIO_supports_pending(bio) &&
|
|
||||||
wolfSSL_BIO_ctrl_pending(bio) == 0) {
|
|
||||||
ret = WOLFSSL_CBIO_ERR_WANT_READ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* previous WOLFSSL_BIO in list working towards head of list */
|
/* previous WOLFSSL_BIO in list working towards head of list */
|
||||||
bio = bio->prev;
|
bio = bio->prev;
|
||||||
|
@ -135,7 +135,11 @@ int BioReceive(WOLFSSL* ssl, char* buf, int sz, void* ctx)
|
|||||||
|
|
||||||
recvd = wolfSSL_BIO_read(ssl->biord, buf, sz);
|
recvd = wolfSSL_BIO_read(ssl->biord, buf, sz);
|
||||||
if (recvd <= 0) {
|
if (recvd <= 0) {
|
||||||
if (ssl->biord->type == WOLFSSL_BIO_SOCKET) {
|
if (wolfSSL_BIO_supports_pending(ssl->biord) &&
|
||||||
|
wolfSSL_BIO_ctrl_pending(ssl->biord) == 0) {
|
||||||
|
return WOLFSSL_CBIO_ERR_WANT_READ;
|
||||||
|
}
|
||||||
|
else if (ssl->biord->type == WOLFSSL_BIO_SOCKET) {
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (recvd == 0) {
|
if (recvd == 0) {
|
||||||
|
Reference in New Issue
Block a user