We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4043e9 commit a6922dcCopy full SHA for a6922dc
libraries/ESP8266WiFi/src/WiFiClientSecure.cpp
@@ -193,6 +193,12 @@ class SSLContext
193
return cb;
194
}
195
196
+ // similar to availble, but doesn't return exact size
197
+ bool hasData()
198
+ {
199
+ return _available > 0 || (s_io_ctx && s_io_ctx->getSize() > 0);
200
+ }
201
+
202
bool loadObject(int type, Stream& stream, size_t size)
203
{
204
std::unique_ptr<uint8_t[]> buf(new uint8_t[size]);
@@ -458,7 +464,7 @@ err x N N
458
464
uint8_t WiFiClientSecure::connected()
459
465
460
466
if (_ssl) {
461
- if (_ssl->available()) {
467
+ if (_ssl->hasData()) {
462
468
return true;
463
469
470
if (_client && _client->state() == ESTABLISHED && _ssl->connected()) {
0 commit comments