Bug 1261318 - make sure brotli context is created in onstoprequest r=bagder a=lizzard
authorPatrick McManus <mcmanus@ducksong.com>
Fri, 01 Apr 2016 15:14:22 -0400
changeset 323830 00ab94f6a5bc64291aa681c8fc6261bc6fda7f68
parent 323829 6b279bfa8288a27d513b252382ca5ab640fe5387
child 323831 2d3700b39df4122aabdce12e895258be9ad25ee6
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbagder, lizzard
bugs1261318
milestone47.0a2
Bug 1261318 - make sure brotli context is created in onstoprequest r=bagder a=lizzard MozReview-Commit-ID: BTgBioESJNt
netwerk/streamconv/converters/nsHTTPCompressConv.cpp
--- a/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
+++ b/netwerk/streamconv/converters/nsHTTPCompressConv.cpp
@@ -139,17 +139,17 @@ nsHTTPCompressConv::OnStopRequest(nsIReq
     nsCOMPtr<nsIForcePendingChannel> fpChannel = do_QueryInterface(request);
     bool isPending = false;
     if (request) {
       request->IsPending(&isPending);
     }
     if (fpChannel && !isPending) {
       fpChannel->ForcePending(true);
     }
-    if (mBrotli->mTotalOut == 0 && !BrotliStateIsStreamEnd(&mBrotli->mState)) {
+    if (mBrotli && (mBrotli->mTotalOut == 0) && !BrotliStateIsStreamEnd(&mBrotli->mState)) {
       status = NS_ERROR_INVALID_CONTENT_ENCODING;
     }
     LOG(("nsHttpCompresssConv %p onstop brotlihandler rv %x\n", this, status));
     if (fpChannel && !isPending) {
       fpChannel->ForcePending(false);
     }
   }
   return mListener->OnStopRequest(request, aContext, status);