Skip to content

Commit 179ca6e

Browse files
committed
addresses double connecting
1 parent d666d1a commit 179ca6e

File tree

1 file changed

+4
-1
lines changed
  • common/src/main/java/org/red5/server/scope

1 file changed

+4
-1
lines changed

common/src/main/java/org/red5/server/scope/Scope.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,12 @@ public boolean connect(IConnection conn, Object[] params) {
269269
}
270270
// checking the connection again? why?
271271
if (!conn.isConnected()) {
272+
log.warn("Connection is not connected.");
272273
// timeout while connecting client
273274
return false;
274275
}
275276
// add the client and event listener
276-
if (clients.add(client) && addEventListener(conn)) {
277+
if (clients.contains(client) || (clients.add(client) && addEventListener(conn))) {
277278
log.debug("Added client");
278279
// increment conn stats
279280
connectionStats.increment();
@@ -287,6 +288,8 @@ public boolean connect(IConnection conn, Object[] params) {
287288
}
288289
}
289290
return true;
291+
} else {
292+
log.warn("Connection failed, client not added.");
290293
}
291294
} else {
292295
log.debug("Connection failed, scope is disabled");

0 commit comments

Comments
 (0)