/* vim:set 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/. */
// ConnectionEntry // // nsHttpConnectionMgr::mCT maps connection info hash key to ConnectionEntry // object, which contains list of active and idle connections as well as the // list of pending transactions. class ConnectionEntry { public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ConnectionEntry) explicit ConnectionEntry(nsHttpConnectionInfo* ci);
HttpConnectionBase* GetH2orH3ActiveConn(); // Make an active spdy connection DontReuse. // TODO: this is a helper function and should nbe improved. bool MakeFirstActiveSpdyConnDontReuse();
// Spdy sometimes resolves the address in the socket manager in order // to re-coalesce sharded HTTP hosts. The dotted decimal address is // combined with the Anonymous flag and OA from the connection information // to build the hash key for hosts in the same ip pool. //
nsTArray<nsCString> mCoalescingKeys;
// This is a list of addresses matching the coalescing keys. // This is necessary to check if the origin's DNS entries // contain the IP address of the active connection.
nsTArray<NetAddr> mAddresses;
// To have the UsingSpdy flag means some host with the same connection // entry has done NPN=spdy/* at some point. It does not mean every // connection is currently using spdy. bool mUsingSpdy : 1;
// Determines whether or not we can continue to use spdy-enabled // connections in the future. This is generally set to false either when // some connection here encounters connection-based auth (such as NTLM) // or when some connection here encounters a server that is totally // busted (such as it fails to properly perform the h2 handshake). bool mCanUseSpdy : 1;
// Flags to remember our happy-eyeballs decision. // Reset only by Ctrl-F5 reload. // True when we've first connected an IPv4 server for this host, // initially false. bool mPreferIPv4 : 1; // True when we've first connected an IPv6 server for this host, // initially false. bool mPreferIPv6 : 1;
// True if this connection entry has initiated a socket bool mUsedForConnection : 1;
// Set the IP family preference flags according the connected family void RecordIPFamilyPreference(uint16_t family); // Resets all flags to their default values void ResetIPFamilyPreference(); // True iff there is currently an established IP family preference bool PreferenceKnown() const;
// Return the count of pending transactions for all window ids.
size_t PendingQueueLength() const;
size_t PendingQueueLengthForWindow(uint64_t windowId) const;
// Append transactions to the |result| whose window id // is equal to |windowId|. // NOTE: maxCount == 0 will get all transactions in the queue. void AppendPendingQForFocusedWindow(
uint64_t windowId, nsTArray<RefPtr<PendingTransactionInfo>>& result,
uint32_t maxCount = 0);
// Append transactions whose window id isn't equal to |windowId|. // NOTE: windowId == 0 will get all transactions for both // focused and non-focused windows. void AppendPendingQForNonFocusedWindows(
uint64_t windowId, nsTArray<RefPtr<PendingTransactionInfo>>& result,
uint32_t maxCount = 0);
// Remove the empty pendingQ in |mPendingTransactionTable|. void RemoveEmptyPendingQ();
// Return total active connection count, which is the sum of // active connections and unconnected half open connections.
uint32_t TotalActiveConnections() const;
nsTArray<RefPtr<nsHttpConnection>> mIdleConns; // idle persistent connections
nsTArray<RefPtr<HttpConnectionBase>> mActiveConns; // active connections // When a connection is added to this mPendingConns list, it is primarily // to keep the connection alive and to continue serving its ongoing // transaction. While in this list, the connection will not be available to // serve any new transactions and will remain here until its current // transaction is complete.
nsTArray<RefPtr<HttpConnectionBase>> mPendingConns; // "fake" http2 websocket connections that needs to be cleaned up on shutdown
nsTArray<RefPtr<HttpConnectionBase>> mH2WebsocketConns;
nsTArray<RefPtr<DnsAndConnectSocket>>
mDnsAndConnectSockets; // dns resolution and half open connections
// If serverCertificateHashes are used, these are stored here
nsTArray<RefPtr<nsIWebTransportHash>> mServerCertHashes;
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.