Handle MBEDTLS_ERR_NET_CONN_RESET errors

This commit is contained in:
James Hilliard committed 2022-04-04 17:17:17 -06:00
1 parent 0ed64707f3
commit 3ec17c41be
3 files changed
+46 -12

No files matched your search

+10
View File
@@ -88,6 +88,16 @@ bool mg_sock_would_block(void) {
;
}
bool mg_sock_conn_reset(void);
bool mg_sock_conn_reset(void) {
int err = MG_SOCK_ERRNO;
#if MG_ARCH == MG_ARCH_WIN32 && MG_ENABLE_WINSOCK
return err == WSAECONNRESET;
#else
return err == EPIPE || err == ECONNRESET;
#endif
}
static void iolog(struct mg_connection *c, char *buf, long n, bool r) {
if (n == 0) {
// Do nothing