Bug 1421963: lock around SCTP input processing, not just the receive callback r=drno

This commit is contained in:
Randell Jesup 2017-12-07 13:24:46 -05:00
Родитель 882ad2f961
Коммит edbe55cb90
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -817,6 +817,7 @@ DataChannelConnection::SctpDtlsInput(TransportFlow *flow,
}
}
// Pass the data to SCTP
MutexAutoLock lock(mLock);
usrsctp_conninput(static_cast<void *>(this), data, len, 0);
}
@ -1224,7 +1225,7 @@ DataChannelConnection::SendDeferredMessages()
RefPtr<DataChannel> channel; // we may null out the refs to this
// This may block while something is modifying channels, but should not block for IO
MutexAutoLock lock(mLock);
mLock.AssertCurrentThreadOwns();
LOG(("SendDeferredMessages called, pending type: %d", mPendingType));
if (!mPendingType) {
@ -2307,7 +2308,7 @@ DataChannelConnection::ReceiveCallback(struct socket* sock, void *data, size_t d
if (!data) {
usrsctp_close(sock); // SCTP has finished shutting down
} else {
MutexAutoLock lock(mLock);
mLock.AssertCurrentThreadOwns();
if (flags & MSG_NOTIFICATION) {
HandleNotification(static_cast<union sctp_notification *>(data), datalen);
} else {