Merge pull request #195 from sstefonic/fixInputStreamRead

fix read() in WolfSSLInputStream to reflect end of stream
pull/196/head
Chris Conlon 2024-05-22 15:22:53 -06:00 committed by GitHub
commit 37cf4dc7d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -2380,10 +2380,16 @@ public class WolfSSLSocket extends SSLSocket {
@Override
public synchronized int read() throws IOException {
int ret;
byte[] data = new byte[1];
try {
this.read(data, 0, 1);
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);