1
This commit is contained in:
1 parent
92a797ab66
commit
97fa002de3
2 files changed
+14
No files matched your search
@@ -222,6 +222,18 @@ void etcpmon_client_disconnect(struct etcpmon_client* client) {
|
||||
client->fully_connected = 0;
|
||||
client->recv_len = 0;
|
||||
client->selected_peer_id = 0;
|
||||
|
||||
/* Очистить очередь pending requests и сбросить seq_id */
|
||||
struct etcpmon_pending_request* req = client->pending_head;
|
||||
while (req) {
|
||||
struct etcpmon_pending_request* next = req->next;
|
||||
free(req);
|
||||
req = next;
|
||||
}
|
||||
client->pending_head = NULL;
|
||||
client->pending_tail = NULL;
|
||||
client->next_seq_id = 1;
|
||||
client->last_response_seq_id = 0;
|
||||
}
|
||||
|
||||
int etcpmon_client_is_connected(const struct etcpmon_client* client) {
|
||||
|
||||
@@ -733,6 +733,8 @@ static void OnDisconnect(struct etcpmon_app* app) {
|
||||
|
||||
etcpmon_client_disconnect(app->client);
|
||||
app->isConnected = 0;
|
||||
app->need_initial_request = 1;
|
||||
app->last_selected_peer_id = 0; // Сбросить для автоматического выбора при переподключении
|
||||
UpdateUIState(app);
|
||||
etcpmon_gui_clear_metrics(app);
|
||||
etcpmon_gui_set_status(app, "Disconnected");
|
||||
|
||||
Reference in new issue
Block a user