You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using Red5 compiled from 343aa92, and I believe I found a bug that result in connections to wrong scopes, due a race condition.
I have a Red5 server with an app called video. When two Flash clients connect at the same time to a scope video/scope1, sometimes one client end up connected to scope video.
I have checked the code and found a possible cause in ScopeResolver class.
In the method resolveScope(IScope root, String path), the root scope is default and the path is video/scope1. In the first iteration of the loop, scope will be set to video for both connections, since scope video was previously created by the app. In the second iteration of the loop, scope.hasChildScope(child) will return false for both connections, and both will try to create the scope scope1. Since the scope.children is concurrent, only one of the connections will succeed, and set it's scope to scope1. The other connection will fail, staying in scope video, and since this is not the root scope the code will not throw a ScopeNotFoundException.
I also tested with the last commit on master, 90add06, and was able to reproduce this bug.
I will submit a pull request with a possible fix for this.
The text was updated successfully, but these errors were encountered:
Hello,
I am using Red5 compiled from 343aa92, and I believe I found a bug that result in connections to wrong scopes, due a race condition.
I have a Red5 server with an app called video. When two Flash clients connect at the same time to a scope video/scope1, sometimes one client end up connected to scope video.
I have checked the code and found a possible cause in ScopeResolver class.
In the method
resolveScope(IScope root, String path)
, the root scope isdefault
and the path isvideo/scope1
. In the first iteration of the loop,scope
will be set tovideo
for both connections, since scopevideo
was previously created by the app. In the second iteration of the loop,scope.hasChildScope(child)
will return false for both connections, and both will try to create the scopescope1
. Since thescope.children
is concurrent, only one of the connections will succeed, and set it's scope toscope1
. The other connection will fail, staying in scopevideo
, and since this is not the root scope the code will not throw aScopeNotFoundException
.I also tested with the last commit on
master
, 90add06, and was able to reproduce this bug.I will submit a pull request with a possible fix for this.
The text was updated successfully, but these errors were encountered: