From 4dcb15068c35c526cf5a27cdc000b174d9ca54a2 Mon Sep 17 00:00:00 2001 From: "ruslan%netscape.com" Date: Mon, 10 Apr 2000 22:24:54 +0000 Subject: [PATCH] Merge in GetSecurityInfo fix from the main branch git-svn-id: svn://10.0.0.236/branches/linkclickfix_tmp_branch@65572 18797224-902f-48f8-a5cc-f745e15eee43 --- .../protocol/http/src/nsHTTPChannel.cpp | 21 +++++++++++++++---- .../netwerk/protocol/http/src/nsHTTPChannel.h | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp index ff5a699f8ba..2cb2067e3cb 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.cpp @@ -1066,7 +1066,7 @@ nsHTTPChannel::CacheReceivedResponse(nsIStreamListener *aListener, // ruslan/hack: don't cache secure connections for now nsCOMPtr securityInfo; - if (GetSecurityInfo (getter_AddRefs (securityInfo)) && securityInfo) + if (NS_SUCCEEDED (GetSecurityInfo (getter_AddRefs (securityInfo))) && securityInfo) return NS_OK; // If the current response is itself from the cache rather than the network @@ -1471,6 +1471,12 @@ nsresult nsHTTPChannel::ResponseCompleted(nsIStreamListener *aListener, { nsresult rv = NS_OK; + { + // ruslan: grab the security info before the transport disappears + nsCOMPtr secInfo; + GetSecurityInfo (getter_AddRefs (secInfo)); // this will store it + } + // // First: // @@ -2136,13 +2142,20 @@ nsHTTPChannel::GetSecurityInfo (nsISupports * *aSecurityInfo) if (!aSecurityInfo) return NS_ERROR_NULL_POINTER; - nsCOMPtr trans; - if (mRequest) { + nsCOMPtr trans; + mRequest -> GetTransport (getter_AddRefs (trans)); if (trans) - return trans -> GetSecurityInfo (aSecurityInfo); + trans -> GetSecurityInfo (getter_AddRefs (mSecurityInfo)); + + if (mSecurityInfo) + { + *aSecurityInfo = mSecurityInfo; + NS_ADDREF (*aSecurityInfo); + } + } return NS_OK; } diff --git a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h index d729b5d69ce..1d676bfadb8 100644 --- a/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h +++ b/mozilla/netwerk/protocol/http/src/nsHTTPChannel.h @@ -174,6 +174,7 @@ protected: PRBool mPipeliningAllowed; nsHTTPPipelinedRequest* mPipelinedRequest; + nsCOMPtr mSecurityInfo; }; #endif /* _nsHTTPChannel_h_ */