Bug 778680 part 2 - Fix incorrect nsresult usage in netwerk/; r=jduell

This commit is contained in:
Aryeh Gregor 2012-08-01 11:17:09 +03:00
parent c25112c690
commit 8f1dd8b01a
3 changed files with 7 additions and 5 deletions

View File

@ -29,7 +29,7 @@ namespace net {
HttpChannelParent::HttpChannelParent(PBrowserParent* iframeEmbedding)
: mIPCClosed(false)
, mStoredStatus(0)
, mStoredStatus(NS_OK)
, mStoredProgress(0)
, mStoredProgressMax(0)
, mSentRedirect1Begin(false)

View File

@ -89,7 +89,7 @@ nsHttpBasicAuth::GenerateCredentials(nsIHttpAuthenticableChannel *authChannel,
}
NS_IMETHODIMP
nsHttpBasicAuth::GetAuthFlags(nsresult *flags)
nsHttpBasicAuth::GetAuthFlags(PRUint32 *flags)
{
*flags = REQUEST_BASED | REUSABLE_CREDENTIALS | REUSABLE_CHALLENGE;
return NS_OK;

View File

@ -297,7 +297,8 @@ nsHttpConnectionMgr::CancelTransaction(nsHttpTransaction *trans, nsresult reason
LOG(("nsHttpConnectionMgr::CancelTransaction [trans=%x reason=%x]\n", trans, reason));
NS_ADDREF(trans);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgCancelTransaction, reason, trans);
nsresult rv = PostEvent(&nsHttpConnectionMgr::OnMsgCancelTransaction,
static_cast<PRInt32>(reason), trans);
if (NS_FAILED(rv))
NS_RELEASE(trans);
return rv;
@ -1879,6 +1880,7 @@ nsHttpConnectionMgr::OnMsgCancelTransaction(PRInt32 reason, void *param)
NS_ABORT_IF_FALSE(PR_GetCurrentThread() == gSocketThread, "wrong thread");
LOG(("nsHttpConnectionMgr::OnMsgCancelTransaction [trans=%p]\n", param));
nsresult closeCode = static_cast<nsresult>(reason);
nsHttpTransaction *trans = (nsHttpTransaction *) param;
//
// if the transaction owns a connection and the transaction is not done,
@ -1887,7 +1889,7 @@ nsHttpConnectionMgr::OnMsgCancelTransaction(PRInt32 reason, void *param)
//
nsAHttpConnection *conn = trans->Connection();
if (conn && !trans->IsDone())
conn->CloseTransaction(trans, reason);
conn->CloseTransaction(trans, closeCode);
else {
nsConnectionEntry *ent = LookupConnectionEntry(trans->ConnectionInfo(),
nullptr, trans);
@ -1900,7 +1902,7 @@ nsHttpConnectionMgr::OnMsgCancelTransaction(PRInt32 reason, void *param)
NS_RELEASE(temp); // b/c NS_RELEASE nulls its argument!
}
}
trans->Close(reason);
trans->Close(closeCode);
}
NS_RELEASE(trans);
}