/* vim:t ts=4 sw=2 sts=2 et cin: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// HttpLog.h should generally be included first #include"HttpLog.h"
// When this transaction has already established a half-open // connection, we want to prevent any duplicate half-open // connections from being established and bound to this // transaction. Allow only use of an idle persistent connection // (if found) for transactions referred by a half-open connection. bool alreadyDnsAndSockOrWaitingForTLS = false; if (mDnsAndSock) {
MOZ_ASSERT(!mActiveConn);
RefPtr<DnsAndConnectSocket> dnsAndSock = do_QueryReferent(mDnsAndSock);
LOG(
("PendingTransactionInfo::IsAlreadyClaimedInitializingConn " "[trans=%p, dnsAndSock=%p]\n",
mTransaction.get(), dnsAndSock.get())); if (dnsAndSock) {
alreadyDnsAndSockOrWaitingForTLS = true;
} else { // If we have not found the halfOpen socket, remove the pointer.
mDnsAndSock = nullptr;
}
} elseif (mActiveConn) {
MOZ_ASSERT(!mDnsAndSock);
RefPtr<HttpConnectionBase> activeConn = do_QueryReferent(mActiveConn);
LOG(
("PendingTransactionInfo::IsAlreadyClaimedInitializingConn " "[trans=%p, activeConn=%p]\n",
mTransaction.get(), activeConn.get())); // Check if this transaction claimed a connection that is still // performing tls handshake with a NullHttpTransaction or it is between // finishing tls and reclaiming (When nullTrans finishes tls handshake, // httpConnection does not have a transaction any more and a // ReclaimConnection is dispatched). But if an error occurred the // connection will be closed, it will exist but CanReused will be // false. if (activeConn &&
((activeConn->Transaction() &&
activeConn->Transaction()->IsNullTransaction()) ||
(!activeConn->Transaction() && activeConn->CanReuse()))) {
alreadyDnsAndSockOrWaitingForTLS = true;
} else { // If we have not found the connection, remove the pointer.
mActiveConn = nullptr;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.