mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
WiFiClientSecure rx overflow fixes
- Increase plaintext rx buffer size to 4096 - Request more data from axtls only when rx buffer is empty
This commit is contained in:
parent
defc049515
commit
77428baddc
@ -50,7 +50,7 @@ extern "C"
|
|||||||
#define SSL_DEBUG_OPTS 0
|
#define SSL_DEBUG_OPTS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SSL_RX_BUF_SIZE 1536
|
#define SSL_RX_BUF_SIZE 4096
|
||||||
|
|
||||||
class SSLContext {
|
class SSLContext {
|
||||||
public:
|
public:
|
||||||
@ -92,10 +92,12 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
int read(uint8_t* dst, size_t size) {
|
int read(uint8_t* dst, size_t size) {
|
||||||
if (size > _rxbuf->getSize()) {
|
if (!_rxbuf->getSize()) {
|
||||||
_readAll();
|
_readAll();
|
||||||
}
|
}
|
||||||
return _rxbuf->read(reinterpret_cast<char*>(dst), size);
|
size_t available = _rxbuf->getSize();
|
||||||
|
size_t will_read = (available < size) ? available : size;
|
||||||
|
return _rxbuf->read(reinterpret_cast<char*>(dst), will_read);
|
||||||
}
|
}
|
||||||
|
|
||||||
int read() {
|
int read() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user