summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol/http/ConnectionEntry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'netwerk/protocol/http/ConnectionEntry.cpp')
-rw-r--r--netwerk/protocol/http/ConnectionEntry.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/netwerk/protocol/http/ConnectionEntry.cpp b/netwerk/protocol/http/ConnectionEntry.cpp
index 7b59011cd3..dc0dfd103c 100644
--- a/netwerk/protocol/http/ConnectionEntry.cpp
+++ b/netwerk/protocol/http/ConnectionEntry.cpp
@@ -124,6 +124,7 @@ void ConnectionEntry::DisallowHttp2() {
// Can't coalesce if we're not using spdy
mCoalescingKeys.Clear();
+ mAddresses.Clear();
}
void ConnectionEntry::DontReuseHttp3Conn() {
@@ -137,6 +138,7 @@ void ConnectionEntry::DontReuseHttp3Conn() {
// Can't coalesce if we're not using http3
mCoalescingKeys.Clear();
+ mAddresses.Clear();
}
void ConnectionEntry::RecordIPFamilyPreference(uint16_t family) {
@@ -447,6 +449,7 @@ void ConnectionEntry::ClosePersistentConnections() {
}
mCoalescingKeys.Clear();
+ mAddresses.Clear();
}
uint32_t ConnectionEntry::PruneDeadConnections() {
@@ -969,18 +972,16 @@ bool ConnectionEntry::MaybeProcessCoalescingKeys(nsIDNSAddrRecord* dnsRecord,
return false;
}
- nsTArray<NetAddr> addressSet;
- nsresult rv = dnsRecord->GetAddresses(addressSet);
-
- if (NS_FAILED(rv) || addressSet.IsEmpty()) {
+ nsresult rv = dnsRecord->GetAddresses(mAddresses);
+ if (NS_FAILED(rv) || mAddresses.IsEmpty()) {
return false;
}
- for (uint32_t i = 0; i < addressSet.Length(); ++i) {
- if ((addressSet[i].raw.family == AF_INET && addressSet[i].inet.ip == 0) ||
- (addressSet[i].raw.family == AF_INET6 &&
- addressSet[i].inet6.ip.u64[0] == 0 &&
- addressSet[i].inet6.ip.u64[1] == 0)) {
+ for (uint32_t i = 0; i < mAddresses.Length(); ++i) {
+ if ((mAddresses[i].raw.family == AF_INET && mAddresses[i].inet.ip == 0) ||
+ (mAddresses[i].raw.family == AF_INET6 &&
+ mAddresses[i].inet6.ip.u64[0] == 0 &&
+ mAddresses[i].inet6.ip.u64[1] == 0)) {
// Bug 1680249 - Don't create the coalescing key if the ip address is
// `0.0.0.0` or `::`.
LOG(
@@ -991,7 +992,7 @@ bool ConnectionEntry::MaybeProcessCoalescingKeys(nsIDNSAddrRecord* dnsRecord,
}
nsCString* newKey = mCoalescingKeys.AppendElement(nsCString());
newKey->SetLength(kIPv6CStrBufSize + 26);
- addressSet[i].ToStringBuffer(newKey->BeginWriting(), kIPv6CStrBufSize);
+ mAddresses[i].ToStringBuffer(newKey->BeginWriting(), kIPv6CStrBufSize);
newKey->SetLength(strlen(newKey->BeginReading()));
if (mConnInfo->GetAnonymous()) {
newKey->AppendLiteral("~A:");