diff --git a/netwerk/base/Predictor.cpp b/netwerk/base/Predictor.cpp index a6300b14fbfd..e7746b0db920 100644 --- a/netwerk/base/Predictor.cpp +++ b/netwerk/base/Predictor.cpp @@ -1369,7 +1369,8 @@ Predictor::Prefetch(nsIURI *uri, nsIURI *referrer, return NS_ERROR_UNEXPECTED; } - httpChannel->SetReferrer(referrer); + rv = httpChannel->SetReferrer(referrer); + NS_ENSURE_SUCCESS(rv, rv); // XXX - set a header here to indicate this is a prefetch? nsCOMPtr listener = new PrefetchListener(verifier, uri, diff --git a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp index 95ba1f1158eb..ab33b4d03a61 100644 --- a/netwerk/base/nsAsyncRedirectVerifyHelper.cpp +++ b/netwerk/base/nsAsyncRedirectVerifyHelper.cpp @@ -271,8 +271,8 @@ nsAsyncRedirectVerifyHelper::IsOldChannelCanceled() nsCOMPtr oldChannelInternal = do_QueryInterface(mOldChan); if (oldChannelInternal) { - oldChannelInternal->GetCanceled(&canceled); - if (canceled) { + nsresult rv = oldChannelInternal->GetCanceled(&canceled); + if (NS_SUCCEEDED(rv) && canceled) { return true; } } else if (mOldChan) { diff --git a/netwerk/protocol/http/Http2Stream.cpp b/netwerk/protocol/http/Http2Stream.cpp index bd42d4951c4c..9d129d81424d 100644 --- a/netwerk/protocol/http/Http2Stream.cpp +++ b/netwerk/protocol/http/Http2Stream.cpp @@ -416,7 +416,11 @@ Http2Stream::ParseHttpRequestHeaders(const char *buf, nsAutoCString authorityHeader; nsAutoCString hashkey; - head->GetHeader(nsHttp::Host, authorityHeader); + nsresult rv = head->GetHeader(nsHttp::Host, authorityHeader); + if (NS_FAILED(rv)) { + MOZ_ASSERT(false); + return rv; + } nsAutoCString requestURI; head->RequestURI(requestURI); @@ -516,7 +520,11 @@ Http2Stream::GenerateOpen() nsCString compressedData; nsAutoCString authorityHeader; - head->GetHeader(nsHttp::Host, authorityHeader); + nsresult rv = head->GetHeader(nsHttp::Host, authorityHeader); + if (NS_FAILED(rv)) { + MOZ_ASSERT(false); + return rv; + } nsDependentCString scheme(head->IsHTTPS() ? "https" : "http"); if (head->IsConnect()) { @@ -540,13 +548,14 @@ Http2Stream::GenerateOpen() nsAutoCString path; head->Method(method); head->Path(path); - mSession->Compressor()->EncodeHeaderBlock(mFlatHttpRequestHeaders, - method, - path, - authorityHeader, - scheme, - head->IsConnect(), - compressedData); + rv = mSession->Compressor()->EncodeHeaderBlock(mFlatHttpRequestHeaders, + method, + path, + authorityHeader, + scheme, + head->IsConnect(), + compressedData); + NS_ENSURE_SUCCESS(rv, rv); int64_t clVal = mSession->Compressor()->GetParsedContentLength(); if (clVal != -1) { diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index fb09dcdba233..aaaa7a340659 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2596,7 +2596,8 @@ HttpBaseChannel::GetLastModifiedTime(PRTime* lastModifiedTime) if (!mResponseHead) return NS_ERROR_NOT_AVAILABLE; uint32_t lastMod; - mResponseHead->GetLastModifiedValue(&lastMod); + nsresult rv = mResponseHead->GetLastModifiedValue(&lastMod); + NS_ENSURE_SUCCESS(rv, rv); *lastModifiedTime = lastMod; return NS_OK; } diff --git a/netwerk/protocol/http/HttpChannelChild.cpp b/netwerk/protocol/http/HttpChannelChild.cpp index 9db1b8b8ae3b..67091227c5e2 100644 --- a/netwerk/protocol/http/HttpChannelChild.cpp +++ b/netwerk/protocol/http/HttpChannelChild.cpp @@ -1921,7 +1921,8 @@ HttpChannelChild::Resume() SendResume(); } if (mCallOnResume) { - AsyncCall(mCallOnResume); + rv = AsyncCall(mCallOnResume); + NS_ENSURE_SUCCESS(rv, rv); mCallOnResume = nullptr; } } diff --git a/netwerk/protocol/http/NullHttpTransaction.cpp b/netwerk/protocol/http/NullHttpTransaction.cpp index fefed265002c..501407795f3c 100644 --- a/netwerk/protocol/http/NullHttpTransaction.cpp +++ b/netwerk/protocol/http/NullHttpTransaction.cpp @@ -66,13 +66,14 @@ public: RefPtr channel = new NullHttpChannel(); rv = channel->Init(uri, 0, nullptr, 0, nullptr); MOZ_ASSERT(NS_SUCCEEDED(rv)); - mActivityDistributor->ObserveActivity( + rv = mActivityDistributor->ObserveActivity( nsCOMPtr(do_QueryObject(channel)), mActivityType, mActivitySubtype, mTimestamp, mExtraSizeData, mExtraStringData); + NS_ENSURE_SUCCESS(rv, rv); return NS_OK; } diff --git a/netwerk/protocol/http/nsHttpAuthCache.cpp b/netwerk/protocol/http/nsHttpAuthCache.cpp index bcc49ffa3d33..3d2ed8476b56 100644 --- a/netwerk/protocol/http/nsHttpAuthCache.cpp +++ b/netwerk/protocol/http/nsHttpAuthCache.cpp @@ -589,7 +589,8 @@ nsHttpAuthNode::SetAuthEntry(const char *path, } else { // update the entry... - entry->Set(path, realm, creds, challenge, ident, metadata); + nsresult rv = entry->Set(path, realm, creds, challenge, ident, metadata); + NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; diff --git a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp index dda921eee083..9d8252d86e77 100644 --- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp +++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp @@ -111,7 +111,7 @@ nsHttpChannelAuthProvider::Init(nsIHttpAuthenticableChannel *channel) nsresult rv = mAuthChannel->GetURI(getter_AddRefs(mURI)); if (NS_FAILED(rv)) return rv; - mAuthChannel->GetIsSSL(&mUsingSSL); + rv = mAuthChannel->GetIsSSL(&mUsingSSL); if (NS_FAILED(rv)) return rv; nsCOMPtr proxied(do_QueryInterface(channel)); diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp index 2fc030e0c72a..a83a6faca332 100644 --- a/netwerk/protocol/http/nsHttpConnection.cpp +++ b/netwerk/protocol/http/nsHttpConnection.cpp @@ -649,7 +649,8 @@ nsHttpConnection::Activate(nsAHttpTransaction *trans, uint32_t caps, int32_t pri } if (mTLSFilter) { - mTLSFilter->SetProxiedTransaction(trans); + rv = mTLSFilter->SetProxiedTransaction(trans); + NS_ENSURE_SUCCESS(rv, rv); mTransaction = mTLSFilter; } diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index ac8a3824d7d3..0c9ecf66961a 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -1252,7 +1252,8 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent, if ((caps & NS_HTTP_ALLOW_KEEPALIVE) || !conn->IsExperienced()) { LOG((" dispatch to spdy: [conn=%p]\n", conn.get())); trans->RemoveDispatchedAsBlocking(); /* just in case */ - DispatchTransaction(ent, trans, conn); + nsresult rv = DispatchTransaction(ent, trans, conn); + NS_ENSURE_SUCCESS(rv, rv); return NS_OK; } unusedSpdyPersistentConnection = conn; @@ -1341,7 +1342,8 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent, // This will update the class of the connection to be the class of // the transaction dispatched on it. AddActiveConn(conn, ent); - DispatchTransaction(ent, trans, conn); + nsresult rv = DispatchTransaction(ent, trans, conn); + NS_ENSURE_SUCCESS(rv, rv); LOG((" dispatched step 2 (idle) trans=%p\n", trans)); return NS_OK; } diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp index 92cb3b67ae32..22ecd5684711 100644 --- a/netwerk/protocol/http/nsHttpTransaction.cpp +++ b/netwerk/protocol/http/nsHttpTransaction.cpp @@ -1476,7 +1476,9 @@ nsHttpTransaction::HandleContentStart() // notify the connection, give it a chance to cause a reset. bool reset = false; - mConnection->OnHeadersAvailable(this, mRequestHead, mResponseHead, &reset); + nsresult rv = mConnection->OnHeadersAvailable(this, mRequestHead, + mResponseHead, &reset); + NS_ENSURE_SUCCESS(rv, rv); // looks like we should ignore this response, resetting... if (reset) { @@ -1732,7 +1734,8 @@ nsHttpTransaction::ProcessData(char *buf, uint32_t count, uint32_t *countRead) // the excess bytes back to the connection if (mResponseIsComplete && countRemaining) { MOZ_ASSERT(mConnection); - mConnection->PushBack(buf + *countRead, countRemaining); + rv = mConnection->PushBack(buf + *countRead, countRemaining); + NS_ENSURE_SUCCESS(rv, rv); } if (!mContentDecodingCheck && mResponseHead) { @@ -1859,8 +1862,8 @@ nsHttpTransaction::CheckForStickyAuthSchemeAt(nsHttpAtom const& header) nsCOMPtr authenticator(do_CreateInstance(contractid.get())); if (authenticator) { uint32_t flags; - authenticator->GetAuthFlags(&flags); - if (flags & nsIHttpAuthenticator::CONNECTION_BASED) { + nsresult rv = authenticator->GetAuthFlags(&flags); + if (NS_SUCCEEDED(rv) && (flags & nsIHttpAuthenticator::CONNECTION_BASED)) { LOG((" connection made sticky, found %s auth shema", schema.get())); // This is enough to make this transaction keep it's current connection, // prevents the connection from being released back to the pool. diff --git a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp index 39c0b9af84d3..d797dec347b9 100644 --- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp +++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp @@ -935,8 +935,9 @@ nsViewSourceChannel::VisitResponseHeaders(nsIHttpHeaderVisitor *aVisitor) nsAutoCString contentType; nsresult rv = mHttpChannel->GetResponseHeader(contentTypeStr, contentType); - if (NS_SUCCEEDED(rv)) - aVisitor->VisitHeader(contentTypeStr, contentType); + if (NS_SUCCEEDED(rv)) { + return aVisitor->VisitHeader(contentTypeStr, contentType); + } return NS_OK; }