mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-07-07 16:40:00 +02:00
Clean up and return 0 on recv, let task reconnect (#227)
Co-authored-by: tommy <tommy@tommywatson.com>
This commit is contained in:
@ -83,11 +83,11 @@ char * STRATUM_V1_receive_jsonrpc_line(int sockfd)
|
|||||||
memset(recv_buffer, 0, BUFFER_SIZE);
|
memset(recv_buffer, 0, BUFFER_SIZE);
|
||||||
nbytes = recv(sockfd, recv_buffer, BUFFER_SIZE - 1, 0);
|
nbytes = recv(sockfd, recv_buffer, BUFFER_SIZE - 1, 0);
|
||||||
if (nbytes == -1) {
|
if (nbytes == -1) {
|
||||||
//perror("recv");
|
ESP_LOGI(TAG, "Error: recv");
|
||||||
ESP_LOGE(TAG, "recv");
|
if (json_rpc_buffer) {
|
||||||
ESP_LOGI(TAG, "Restarting System because of Error: recv");
|
free(json_rpc_buffer);
|
||||||
vTaskDelay(1000 / portTICK_PERIOD_MS);
|
}
|
||||||
esp_restart();
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
realloc_json_buffer(nbytes);
|
realloc_json_buffer(nbytes);
|
||||||
|
Reference in New Issue
Block a user