Bug 1394564 - Delete current outgoing message when PrimeNewOutgoingMessage fails. r=mcmanus

--HG--
extra : amend_source : 6ac45c6b007dac89195529a2e57ccfbd7ca88b8f
This commit is contained in:
Michal Novotny 2017-11-22 05:17:00 -05:00
Родитель 3307231c00
Коммит 4e89b320f9
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -2051,6 +2051,10 @@ WebSocketChannel::PrimeNewOutgoingMessage()
if (!mCurrentOut)
return;
auto cleanupAfterFailure = MakeScopeExit([&] {
DeleteCurrentOutGoingMessage();
});
WsMsgType msgType = mCurrentOut->GetMsgType();
LOG(("WebSocketChannel::PrimeNewOutgoingMessage "
@ -2070,6 +2074,7 @@ WebSocketChannel::PrimeNewOutgoingMessage()
if (mClientClosed) {
DeleteCurrentOutGoingMessage();
PrimeNewOutgoingMessage();
cleanupAfterFailure.release();
return;
}
@ -2258,6 +2263,8 @@ WebSocketChannel::PrimeNewOutgoingMessage()
// mCurrentOut->Length() bytes from mCurrentOut. The latter may be
// coaleseced into the former for small messages or as the result of the
// compression process.
cleanupAfterFailure.release();
}
void