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) if (new_sockbuf == NULL)
{ {
fprintf(stderr, "Error: realloc failed in recalloc_sock()\n"); fprintf(stderr, "Error: realloc failed in recalloc_sock()\n");
exit(EXIT_FAILURE); esp_restart();
} }
json_rpc_buffer = new_sockbuf; json_rpc_buffer = new_sockbuf;
@ -87,7 +87,7 @@ char *STRATUM_V1_receive_jsonrpc_line(int sockfd)
if (nbytes == -1) if (nbytes == -1)
{ {
perror("recv"); perror("recv");
exit(EXIT_FAILURE); esp_restart();
} }
realloc_json_buffer(nbytes); realloc_json_buffer(nbytes);