mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 16:40:18 +00:00
reflector: Fix removing conference participant
Delete the participant only after we take it's address. Fixes deleting the wrong port.
This commit is contained in:
@@ -932,8 +932,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
const double participant_timeout = 10.0;
|
||||
if(tv_diff(t, it->last_recv) > participant_timeout){
|
||||
std::swap(*it, participants.back());
|
||||
participants.pop_back();
|
||||
log_msg(LOG_LEVEL_NOTICE, "Removing participant\n");
|
||||
std::string msg = "delete-port ";
|
||||
auto addr = reinterpret_cast<struct sockaddr *>(&it->addr);
|
||||
@@ -941,6 +939,9 @@ int main(int argc, char **argv)
|
||||
get_sockaddr_addr_str(addr, addr_str, sizeof(addr_str));
|
||||
msg += get_replica_mod_name(addr_str, get_sockaddr_addr_port(addr));
|
||||
|
||||
std::swap(*it, participants.back());
|
||||
participants.pop_back();
|
||||
|
||||
struct msg_universal *m = (struct msg_universal *) new_message(sizeof(struct msg_universal));
|
||||
strncpy(m->text, msg.c_str(), sizeof(m->text) - 1);
|
||||
log_msg(LOG_LEVEL_NOTICE, "Msg: %s\n", m->text);
|
||||
|
||||
Reference in New Issue
Block a user