Closed LanderN closed 2 years ago
Good catch, thank you for the detailed bug report and the example to reproduce!
The issue is that the id of test_1
is reused to open test_3
(as the stream has been closed) and the other side wrongly routes the open message to the still existing test_1
DataChannel rather than opening a new one as it should.
This is fixed by https://github.com/paullouisageneau/libdatachannel/pull/590
Awesome, thanks!
The fix is released in v0.16.8
.
I'm developing an application where a C++ program interacts with a web client using WebRTC/libdatachannel. I have discovered an issue while implementing functionality that dynamically opens and closes certain datachannels. I was able to reproduce the issue using only C++/libdatachannel 0.16.7.
Relevant parts of the code:
(Compilable example: https://gist.github.com/LanderN/c4dee5cf0bc46bd54fb6ac8de251713e)
What I expect the output to be:
The actual output:
It seems like libdatachannel is somehow mixing up the already closed
test_1
DataChannel with the newtest_3
DataChannel, causing the "DataChannel is closed" error.