Commit 555823e3 authored by valenting's avatar valenting
Browse files

Bug 1641901 - Check the type of OutboundMessage::mMsg before using r=michal,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D77546
parent 08683e31
......@@ -942,12 +942,19 @@ class OutboundMessage {
WsMsgType GetMsgType() const { return mMsgType; }
int32_t Length() {
pString& ref = mMsg.as<pString>();
return ref.mValue.Length();
if (mMsg.is<pString>()) {
return mMsg.as<pString>().mValue.Length();
}
return mMsg.as<StreamWithLength>().mLength;
}
int32_t OrigLength() {
pString& ref = mMsg.as<pString>();
return mDeflated ? ref.mOrigValue.Length() : ref.mValue.Length();
if (mMsg.is<pString>()) {
pString& ref = mMsg.as<pString>();
return mDeflated ? ref.mOrigValue.Length() : ref.mValue.Length();
}
return mMsg.as<StreamWithLength>().mLength;
}
uint8_t* BeginWriting() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment