fix read() to reflect end of stream

pull/195/head
Sage Stefonic 2024-05-21 16:12:55 -07:00
parent b08237d910
commit c6e04d4f40
1 changed files with 6 additions and 1 deletions

View File

@ -2383,7 +2383,12 @@ public class WolfSSLSocket extends SSLSocket {
byte[] data = new byte[1];
try {
this.read(data, 0, 1);
int ret = this.read(data, 0, 1);
/* check for end of stream and other errors */
if (ret < 0) {
return ret;
}
} catch (NullPointerException ne) {
throw new IOException(ne);