Skip to content

Commit

Permalink
No need to prune client list after all
Browse files Browse the repository at this point in the history
It gets dropped a bit later in the worker manager thread.
  • Loading branch information
vkoskiv committed Nov 4, 2023
1 parent 0530d71 commit feff263
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/utils/protocol/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,25 +457,7 @@ struct renderClient *syncWithClients(const struct renderer *r, size_t *count) {
for (size_t i = 0; i < clientCount; ++i) printf("\n");
logr(info, "Client sync finished.\n");

size_t validClients = 0;
for (size_t i = 0; i < clientCount; ++i) {
validClients += clients[i].status == ConnectionFailed ? 0 : 1;
}
if (validClients < clientCount) {
// Prune unavailable clients
struct renderClient *confirmedClients = calloc(validClients, sizeof(*confirmedClients));
size_t j = 0;
for (size_t i = 0; i < clientCount; ++i) {
if (clients[i].status == Synced) {
confirmedClients[j++] = clients[i];
}
}
free(clients);
clients = confirmedClients;
logr(debug, "Pruned %zu clients that failed to sync\n", clientCount - validClients);
}

if (count) *count = validClients;
if (count) *count = clientCount;
free(sync_threads);
return clients;
}
Expand Down

0 comments on commit feff263

Please sign in to comment.