Compare commits

...

5 Commits

Author SHA1 Message Date
c37c88543d Bumped version to 0.11.4 2021-02-22 21:04:31 +01:00
011bfbe46f Merge pull request #342 from paullouisageneau/fix-usrsctp-data-race
Update usrsctp and mitigate possible data race
2021-02-22 19:28:06 +01:00
de2ac6c0c2 Mitigation for data race 2021-02-22 19:05:45 +01:00
75619babd7 Updated usrsctp to v0.9.5.0 2021-02-22 19:00:35 +01:00
fe9a34905b Fixed missing data channels mutex lock 2021-02-22 09:49:03 +01:00
4 changed files with 8 additions and 2 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.7)
project(libdatachannel
VERSION 0.11.3
VERSION 0.11.4
LANGUAGES CXX)
set(PROJECT_DESCRIPTION "WebRTC Data Channels Library")

2
deps/usrsctp vendored

View File

@ -667,6 +667,8 @@ void PeerConnection::forwardMessage(message_ptr message) {
stream);
channel->onOpen(weak_bind(&PeerConnection::triggerDataChannel, this,
weak_ptr<DataChannel>{channel}));
std::unique_lock lock(mDataChannelsMutex); // we are going to emplace
mDataChannels.emplace(stream, channel);
} else {
// Invalid, close the DataChannel

View File

@ -349,6 +349,10 @@ void SctpTransport::incoming(message_ptr message) {
}
PLOG_VERBOSE << "Incoming size=" << message->size();
// TODO: There seems to be a possible data race between usrsctp_sendv() and usrsctp_conninput()
// As a mitigation, lock the send mutex before calling usrsctp_conninput()
std::lock_guard lock(mSendMutex);
usrsctp_conninput(this, message->data(), message->size(), 0);
}