Skip to content
This repository was archived by the owner on Jan 20, 2025. It is now read-only.

Commit 649dd36

Browse files
Adam5Wume-no-dev
authored andcommitted
Fix improper recv callback return when ssl layer returned SSL_CLOSE_NOTIFY (#84)
1 parent f9de677 commit 649dd36

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/ESPAsyncTCP.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ err_t AsyncClient::_recv(tcp_pcb* pcb, pbuf* pb, err_t err) {
399399
ASYNC_TCP_DEBUG("_recv err: %d\n", read_bytes);
400400
_close();
401401
}
402-
return read_bytes;
402+
//return read_bytes;
403403
}
404404
return ERR_OK;
405405
}

src/tcp_axtls.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ int tcp_ssl_read(struct tcp_pcb *tcp, struct pbuf *p) {
406406
} while (p->tot_len - fd_data->pbuf_offset > 0);
407407

408408
tcp_recved(tcp, p->tot_len);
409+
fd_data->tcp_pbuf = NULL;
409410
pbuf_free(p);
410411

411412
return total_bytes;

src/tcp_axtls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
extern "C" {
4141
#endif
4242

43+
#include <stdbool.h>
4344
#include "include/ssl.h"
4445

4546
#define ERR_TCP_SSL_INVALID_SSL -101

0 commit comments

Comments
 (0)