diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index 9afbf6b3..a9aa7bb9 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -0b58b866f87d92267db4577d26eebe10dcf5a96ff53ac5a863dade83f471961c /usr/local/bin/tox-bootstrapd +738c98673260593fc150b8d5b0cb770cd521f469b4eb04c873f19d89bb7238cf /usr/local/bin/tox-bootstrapd diff --git a/toxcore/group_chats.c b/toxcore/group_chats.c index 6ea64ba6..0a80af08 100644 --- a/toxcore/group_chats.c +++ b/toxcore/group_chats.c @@ -6995,23 +6995,30 @@ non_null(1, 2) nullable(3) static void do_peer_delete(const GC_Session *c, GC_Chat *chat, void *userdata) { for (uint32_t i = 1; i < chat->numpeers; ++i) { - const GC_Connection *gconn = get_gc_connection(chat, i); + GC_Connection *gconn = get_gc_connection(chat, i); assert(gconn != nullptr); - if (gconn->pending_delete) { - const GC_Exit_Info *exit_info = &gconn->exit_info; + if (!gconn->pending_delete) { + continue; + } - if (exit_info->exit_type == GC_EXIT_TYPE_TIMEOUT && gconn->confirmed) { - add_gc_peer_timeout_list(chat, gconn); - } + if (!gconn->delete_this_iteration) { + gconn->delete_this_iteration = true; + continue; + } - if (!peer_delete(c, chat, i, userdata)) { - LOGGER_ERROR(chat->log, "Failed to delete peer %u", i); - } + const GC_Exit_Info *exit_info = &gconn->exit_info; - if (i >= chat->numpeers) { - break; - } + if (exit_info->exit_type == GC_EXIT_TYPE_TIMEOUT && gconn->confirmed) { + add_gc_peer_timeout_list(chat, gconn); + } + + if (!peer_delete(c, chat, i, userdata)) { + LOGGER_ERROR(chat->log, "Failed to delete peer %u", i); + } + + if (i >= chat->numpeers) { + break; } } } diff --git a/toxcore/group_common.h b/toxcore/group_common.h index 49c21369..8ef4ddbd 100644 --- a/toxcore/group_common.h +++ b/toxcore/group_common.h @@ -133,6 +133,7 @@ typedef struct GC_Connection { bool pending_key_rotation_request; bool pending_delete; /* true if this peer has been marked for deletion */ + bool delete_this_iteration; /* true if this peer should be deleted this do_gc() iteration*/ GC_Exit_Info exit_info; } GC_Connection;