From 032fe24f2a3bfd908911184625fd3ed7bce4f5cb Mon Sep 17 00:00:00 2001 From: SatoshyBoy <132848052+SatoshyBoy@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:09:16 -0400 Subject: [PATCH] WIFI Failure The firmware halts when it loses the wifi connection. --- components/stratum/stratum_api.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/stratum/stratum_api.c b/components/stratum/stratum_api.c index 5dc958b0..f6dd9695 100644 --- a/components/stratum/stratum_api.c +++ b/components/stratum/stratum_api.c @@ -59,7 +59,7 @@ static void realloc_json_buffer(size_t len) if (new_sockbuf == NULL) { fprintf(stderr, "Error: realloc failed in recalloc_sock()\n"); - exit(EXIT_FAILURE); + esp_restart(); } json_rpc_buffer = new_sockbuf; @@ -87,7 +87,7 @@ char *STRATUM_V1_receive_jsonrpc_line(int sockfd) if (nbytes == -1) { perror("recv"); - exit(EXIT_FAILURE); + esp_restart(); } realloc_json_buffer(nbytes); @@ -347,4 +347,4 @@ void STRATUM_V1_configure_version_rolling(int socket) static void debug_stratum_tx(const char *msg) { ESP_LOGI(TAG, "tx: %s", msg); -} \ No newline at end of file +}