Skip to content

Commit

Permalink
set size equal to ret if ret does not equal RECV_READY or SEND_READY
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruby Martin committed Jul 19, 2024
1 parent bef6379 commit 8f09aae
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions native/com_wolfssl_WolfSSLSession.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,16 +1083,12 @@ JNIEXPORT jint JNICALL Java_com_wolfssl_WolfSSLSession_read
(ret == WOLFJNI_IO_EVENT_SEND_READY)) {
/* loop around and try wolfSSL_read() again */
continue;
} else if (ret == WOLFJNI_IO_EVENT_TIMEOUT ||
ret == WOLFJNI_IO_EVENT_FD_CLOSED ||
ret == WOLFJNI_IO_EVENT_ERROR ||
ret == WOLFJNI_IO_EVENT_POLLHUP ||
ret == WOLFJNI_IO_EVENT_FAIL) {
/* Java will throw SocketTimeoutException or
* SocketException */
break;
} else {
/* other error occurred */
/* Java will throw SocketTimeoutException or
* SocketException if ret equals
* WOLFJNI_IO_EVENT_TIMEOUT, WOLFJNI_IO_EVENT_FD_CLOSED
* WOLFJNI_IO_EVENT_ERROR, WOLFJNI_IO_EVENT_POLLHUP or
* WOLFJNI_IO_EVENT_FAIL */
size = ret;
break;
}
Expand Down

0 comments on commit 8f09aae

Please sign in to comment.