mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 474038 - Don't reuse keep-alive connections for both anonymous and non-anonymous requests; r=(cbiesinger + jonas) sr=jonas
This commit is contained in:
parent
f65cc1e89b
commit
7e1b0db13a
@ -676,6 +676,7 @@ nsHttpChannel::SetupTransaction()
|
||||
// See bug #466080. Transfer LOAD_ANONYMOUS flag to socket-layer.
|
||||
if (mLoadFlags & LOAD_ANONYMOUS) {
|
||||
mCaps |= NS_HTTP_LOAD_ANONYMOUS;
|
||||
mConnectionInfo->SetAnonymous();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIAsyncInputStream> responseStream;
|
||||
|
@ -49,7 +49,10 @@ nsHttpConnectionInfo::SetOriginServer(const nsACString &host, PRInt32 port)
|
||||
// build hash key:
|
||||
//
|
||||
// the hash key uniquely identifies the connection type. two connections
|
||||
// are "equal" if they end up talking the same protocol to the same server.
|
||||
// are "equal" if they end up talking the same protocol to the same server
|
||||
// and are both used for anonymous or non-anonymous connection only;
|
||||
// anonymity of the connection is setup later from nsHttpChannel::AsyncOpen
|
||||
// where we know we use anonymous connection (LOAD_ANONYMOUS load flag)
|
||||
//
|
||||
|
||||
const char *keyHost;
|
||||
@ -64,7 +67,7 @@ nsHttpConnectionInfo::SetOriginServer(const nsACString &host, PRInt32 port)
|
||||
keyPort = Port();
|
||||
}
|
||||
|
||||
mHashKey.AssignLiteral("..");
|
||||
mHashKey.AssignLiteral("...");
|
||||
mHashKey.Append(keyHost);
|
||||
mHashKey.Append(':');
|
||||
mHashKey.AppendInt(keyPort);
|
||||
|
@ -120,6 +120,7 @@ public:
|
||||
PRBool UsingHttpProxy() const { return mUsingHttpProxy; }
|
||||
PRBool UsingSSL() const { return mUsingSSL; }
|
||||
PRInt32 DefaultPort() const { return mUsingSSL ? NS_HTTPS_DEFAULT_PORT : NS_HTTP_DEFAULT_PORT; }
|
||||
void SetAnonymous() { mHashKey.SetCharAt('A', 2); }
|
||||
|
||||
private:
|
||||
nsrefcnt mRef;
|
||||
|
Loading…
Reference in New Issue
Block a user