Skip to content

Commit

Permalink
Fix a fatal bug in Web connectivity. Ids werent correctly assigned.
Browse files Browse the repository at this point in the history
  • Loading branch information
geneotech committed Aug 11, 2024
1 parent 1d14fcc commit 697d5d8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/application/setups/server/server_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ class webrtc_server_detail {

/* We need this since yojimbo can only identify clients by slot (port) */
std::unordered_map<std::string, client_id> id_map;
client_id last_client_id = 0;

auto set_this_server_id(const std::string& new_id) {
std::scoped_lock lk(this_server_id_lk);
Expand All @@ -143,11 +142,8 @@ class webrtc_server_detail {

client_id assign_client_id() {
for (client_id i = 0; i < max_clients; ++i) {
const auto id = last_client_id + i;

if (pcs.find(id) == pcs.end()) {
++last_client_id;
return id;
if (pcs.find(i) == pcs.end()) {
return i;
}
}

Expand Down

0 comments on commit 697d5d8

Please sign in to comment.