Bug 1355680 - set progressMax to -1 when HTTP response head is not available. r?mayhemer
MozReview-Commit-ID: 6xJsYFlCptC
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -751,17 +751,21 @@ HttpChannelChild::OnTransportAndData(con
mUnknownDecoderEventQ.AppendElement(
MakeUnique<MaybeDivertOnDataHttpEvent>(this, data, offset, count));
}
// Hold queue lock throughout all three calls, else we might process a later
// necko msg in between them.
AutoEventEnqueuer ensureSerialDispatch(mEventQ);
- const int64_t progressMax = mResponseHead->ContentLength();
+ int64_t progressMax;
+ if (NS_FAILED(GetContentLength(&progressMax))) {
+ progressMax = -1;
+ }
+
const int64_t progress = offset + count;
// OnTransportAndData will be run on retargeted thread if applicable, however
// OnStatus/OnProgress event can only be fired on main thread. We need to
// dispatch the status/progress event handling back to main thread with the
// appropriate event target for networking.
if (NS_IsMainThread()) {
DoOnStatus(this, transportStatus);