fix: ClientSecure.available() fix for connection closed by remote socket (#9869)
This commit is contained in:
parent
1efab83432
commit
5c22402025
2 changed files with 5 additions and 3 deletions
|
|
@ -305,9 +305,11 @@ int NetworkClientSecure::available() {
|
|||
res = data_to_read(sslclient.get());
|
||||
|
||||
if (res < 0 && !_stillinPlainStart) {
|
||||
log_e("Closing connection on failed available check");
|
||||
if (res != MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
|
||||
log_e("Closing connection on failed available check");
|
||||
}
|
||||
stop();
|
||||
return peeked ? peeked : res;
|
||||
return peeked;
|
||||
}
|
||||
return res + peeked;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
const char *pers = "esp32-tls";
|
||||
|
||||
static int _handle_error(int err, const char *function, int line) {
|
||||
if (err == -30848) {
|
||||
if (err == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
|
||||
return err;
|
||||
}
|
||||
#ifdef MBEDTLS_ERROR_C
|
||||
|
|
|
|||
Loading…
Reference in a new issue