WIFI Failure

The firmware halts when it loses the wifi connection.
This commit is contained in:
SatoshyBoy 2023-09-04 10:09:16 -04:00 committed by Johnny
parent 7f21f5cad9
commit 032fe24f2a

View File

@ -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);
}
}