Bug 584863: make nsHttpChannel::AsyncOpen fail immediately if channel already cancelled. r=biesi
authorJason Duell <jduell.mcbugs@gmail.com>
Tue, 10 Aug 2010 17:50:30 -0700
changeset 49366 1c49a68f1f6bf7595f2f2bd975d50a781dea0369
parent 49365 fe54d69820f8e9e3b802677ec9ee4d7d4027c7cc
child 49367 14342400e38b822ae1fbd091031d380a98b3b98a
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbiesi
bugs584863
milestone2.0b4pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 584863: make nsHttpChannel::AsyncOpen fail immediately if channel already cancelled. r=biesi
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -3244,16 +3244,19 @@ nsHttpChannel::AsyncOpen(nsIStreamListen
     LOG(("nsHttpChannel::AsyncOpen [this=%p]\n", this));
 
     NS_ENSURE_ARG_POINTER(listener);
     NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
     NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
     nsresult rv;
 
+    if (mCanceled)
+        return mStatus;
+
     rv = NS_CheckPortSafety(mURI);
     if (NS_FAILED(rv))
         return rv;
 
     if (!(mConnectionInfo && mConnectionInfo->UsingHttpProxy())) {
         // Start a DNS lookup very early in case the real open is queued the DNS can 
         // happen in parallel. Do not do so in the presence of an HTTP proxy as 
         // all lookups other than for the proxy itself are done by the proxy.