From c8beb0d58b02d523789b02807ba0799f755f96a8 Mon Sep 17 00:00:00 2001 From: "darin%meer.net" Date: Thu, 23 Sep 2004 18:49:17 +0000 Subject: [PATCH] fixes bug 251969 "crash [@ nsHttpChannel::OnStopRequest]" r=timeless sr=bzbarsky --- netwerk/protocol/http/src/nsHttpChannel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netwerk/protocol/http/src/nsHttpChannel.cpp b/netwerk/protocol/http/src/nsHttpChannel.cpp index 6878af0b767..1cf646f3e85 100644 --- a/netwerk/protocol/http/src/nsHttpChannel.cpp +++ b/netwerk/protocol/http/src/nsHttpChannel.cpp @@ -3620,7 +3620,9 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st // grab reference to connection in case we need to retry an // authentication request over it. - nsRefPtr conn = mTransaction->Connection(); + nsRefPtr conn; + if (mCaps & NS_HTTP_STICKY_CONNECTION) + conn = mTransaction->Connection(); // at this point, we're done with the transaction NS_RELEASE(mTransaction); @@ -3629,6 +3631,7 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st // handle auth retry... if (mAuthRetryPending && NS_SUCCEEDED(status)) { + NS_ASSERTION(conn, "we should have a connection"); mAuthRetryPending = PR_FALSE; status = DoAuthRetry(conn); if (NS_SUCCEEDED(status))