Skip to content

Commit

Permalink
Reject duplicate connections from same session
Browse files Browse the repository at this point in the history
bbb-apps now rejects duplicate connection attempts from the same session.
This fixes the problems that happened when a user connected to the same
conference in two different browser tabs, and ended up with two clients
in the same session.
  • Loading branch information
mdalepiane authored and fcecagno committed Apr 1, 2015
1 parent ab97533 commit 645d549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Expand Up @@ -148,7 +148,7 @@ boolean record = (Boolean)params[4];

bbbGW.initLockSettings(room, locked, lsMap);

connInvokerService.addConnection(bbbSession.getInternalUserID(), connection);
boolean success = connInvokerService.addConnection(bbbSession.getInternalUserID(), connection);

String meetingId = bbbSession.getRoom();
String userId = bbbSession.getInternalUserID();
Expand All @@ -175,7 +175,7 @@ boolean record = (Boolean)params[4];

log.info("User joining bbbb-aps: data={}", logStr);

return super.roomConnect(connection, params);
return success && super.roomConnect(connection, params);

}

Expand Down
Expand Up @@ -63,10 +63,10 @@ public void setAppScope(IScope scope) {
bbbAppScope = scope;
}

public void addConnection(String id, IConnection conn) {
public boolean addConnection(String id, IConnection conn) {
if (connections == null) {
System.out.println("Connections is null!!!!");
return;
return false;
}
if (id == null) {
System.out.println("CONN ID IS NULL!!!");
Expand All @@ -75,7 +75,7 @@ public void addConnection(String id, IConnection conn) {
if (conn == null) {
System.out.println("CONN IS NULL");
}
connections.putIfAbsent(id, conn);
return connections.putIfAbsent(id, conn) == null;
}

public void start() {
Expand Down

0 comments on commit 645d549

Please sign in to comment.