Skip to content

Commit 685158d

Browse files
authored
Update HTTPSConnection.cpp for possible ws fix.
Update as mentioned in issue fhessel#89 for possible crash fix on websockets.
1 parent 3e97446 commit 685158d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/HTTPSConnection.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ size_t HTTPSConnection::writeBuffer(byte* buffer, size_t length) {
109109
}
110110

111111
size_t HTTPSConnection::readBytesToBuffer(byte* buffer, size_t length) {
112-
return SSL_read(_ssl, buffer, length);
112+
int ret = SSL_read(_ssl, buffer, length);
113+
if (ret < 0) {
114+
HTTPS_LOGD("SSL_read error: %d", SSL_get_error(_ssl, ret));
115+
}
116+
return ret;
113117
}
114118

115119
size_t HTTPSConnection::pendingByteCount() {

0 commit comments

Comments
 (0)