Skip to content

Commit

Permalink
Merge pull request #210 from rlm2002/timeouts
Browse files Browse the repository at this point in the history
read returns error value to timeout
  • Loading branch information
cconlon authored Jul 19, 2024
2 parents a5863a4 + 8f09aae commit 13da2b0
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 13da2b0

Please sign in to comment.