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_ */