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 defc049 commit 77428baCopy full SHA for 77428ba
libraries/ESP8266WiFi/src/WiFiClientSecure.cpp
@@ -50,7 +50,7 @@ extern "C"
50
#define SSL_DEBUG_OPTS 0
51
#endif
52
53
-#define SSL_RX_BUF_SIZE 1536
+#define SSL_RX_BUF_SIZE 4096
54
55
class SSLContext {
56
public:
@@ -92,10 +92,12 @@ class SSLContext {
92
}
93
94
int read(uint8_t* dst, size_t size) {
95
- if (size > _rxbuf->getSize()) {
+ if (!_rxbuf->getSize()) {
96
_readAll();
97
98
- return _rxbuf->read(reinterpret_cast<char*>(dst), size);
+ size_t available = _rxbuf->getSize();
99
+ size_t will_read = (available < size) ? available : size;
100
+ return _rxbuf->read(reinterpret_cast<char*>(dst), will_read);
101
102
103
int read() {
0 commit comments