Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5c22402

Browse filesBrowse files
authored
fix: ClientSecure.available() fix for connection closed by remote socket (espressif#9869)
1 parent 1efab83 commit 5c22402
Copy full SHA for 5c22402

File tree

2 files changed

+5
-3
lines changed
Filter options

2 files changed

+5
-3
lines changed

‎libraries/NetworkClientSecure/src/NetworkClientSecure.cpp

Copy file name to clipboardExpand all lines: libraries/NetworkClientSecure/src/NetworkClientSecure.cpp
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,11 @@ int NetworkClientSecure::available() {
305305
res = data_to_read(sslclient.get());
306306

307307
if (res < 0 && !_stillinPlainStart) {
308-
log_e("Closing connection on failed available check");
308+
if (res != MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
309+
log_e("Closing connection on failed available check");
310+
}
309311
stop();
310-
return peeked ? peeked : res;
312+
return peeked;
311313
}
312314
return res + peeked;
313315
}

‎libraries/NetworkClientSecure/src/ssl_client.cpp

Copy file name to clipboardExpand all lines: libraries/NetworkClientSecure/src/ssl_client.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
const char *pers = "esp32-tls";
2828

2929
static int _handle_error(int err, const char *function, int line) {
30-
if (err == -30848) {
30+
if (err == MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY) {
3131
return err;
3232
}
3333
#ifdef MBEDTLS_ERROR_C

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.