mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 06:37:30 +09:00
[network] Hold mutex when accessing mSecurityInfo.
This commit is contained in:
parent
202ef2a56a
commit
b83d024efb
1 changed files with 12 additions and 3 deletions
|
|
@ -765,7 +765,10 @@ nsHttpTransaction::ReadSegments(nsAHttpSegmentReader *reader,
|
||||||
|
|
||||||
if (!mConnected && !m0RTTInProgress) {
|
if (!mConnected && !m0RTTInProgress) {
|
||||||
mConnected = true;
|
mConnected = true;
|
||||||
mConnection->GetSecurityInfo(getter_AddRefs(mSecurityInfo));
|
nsCOMPtr<nsISupports> info;
|
||||||
|
mConnection->GetSecurityInfo(getter_AddRefs(info));
|
||||||
|
MutexAutoLock lock(mLock);
|
||||||
|
mSecurityInfo = std::move(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
mDeferredSendProgress = false;
|
mDeferredSendProgress = false;
|
||||||
|
|
@ -1314,7 +1317,10 @@ nsHttpTransaction::Restart()
|
||||||
seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0);
|
seekable->Seek(nsISeekableStream::NS_SEEK_SET, 0);
|
||||||
|
|
||||||
// clear old connection state...
|
// clear old connection state...
|
||||||
mSecurityInfo = nullptr;
|
{
|
||||||
|
MutexAutoLock lock(mLock);
|
||||||
|
mSecurityInfo = nullptr;
|
||||||
|
}
|
||||||
if (mConnection) {
|
if (mConnection) {
|
||||||
if (!mReuseOnRestart) {
|
if (!mReuseOnRestart) {
|
||||||
mConnection->DontReuse();
|
mConnection->DontReuse();
|
||||||
|
|
@ -2489,7 +2495,10 @@ nsHttpTransaction::Finish0RTT(bool aRestart, bool aAlpnChanged /* ignored */)
|
||||||
} else if (!mConnected) {
|
} else if (!mConnected) {
|
||||||
// this is code that was skipped in ::ReadSegments while in 0RTT
|
// this is code that was skipped in ::ReadSegments while in 0RTT
|
||||||
mConnected = true;
|
mConnected = true;
|
||||||
mConnection->GetSecurityInfo(getter_AddRefs(mSecurityInfo));
|
nsCOMPtr<nsISupports> info;
|
||||||
|
mConnection->GetSecurityInfo(getter_AddRefs(info));
|
||||||
|
MutexAutoLock lock(mLock);
|
||||||
|
mSecurityInfo = std::move(info);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue