summaryrefslogtreecommitdiff
path: root/chromium/net/third_party/quiche/src/quiche/quic/core/quic_dispatcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/net/third_party/quiche/src/quiche/quic/core/quic_dispatcher.h')
-rw-r--r--chromium/net/third_party/quiche/src/quiche/quic/core/quic_dispatcher.h47
1 files changed, 29 insertions, 18 deletions
diff --git a/chromium/net/third_party/quiche/src/quiche/quic/core/quic_dispatcher.h b/chromium/net/third_party/quiche/src/quiche/quic/core/quic_dispatcher.h
index f53df8b2447..813655b40b1 100644
--- a/chromium/net/third_party/quiche/src/quiche/quic/core/quic_dispatcher.h
+++ b/chromium/net/third_party/quiche/src/quiche/quic/core/quic_dispatcher.h
@@ -102,8 +102,9 @@ class QUIC_NO_EXPORT QuicDispatcher
// QuicSession::Visitor interface implementation (via inheritance of
// QuicTimeWaitListManager::Visitor):
- // Add the newly issued connection ID to the session map.
- void OnNewConnectionIdSent(
+ // Try to add the new connection ID to the session map. Returns true on
+ // success.
+ bool TryAddNewConnectionId(
const QuicConnectionId& server_connection_id,
const QuicConnectionId& new_connection_id) override;
@@ -244,10 +245,6 @@ class QUIC_NO_EXPORT QuicDispatcher
void ProcessChlo(ParsedClientHello parsed_chlo,
ReceivedPacketInfo* packet_info);
- // Return true if dispatcher wants to destroy session outside of
- // OnConnectionClosed() call stack.
- virtual bool ShouldDestroySessionAsynchronously();
-
QuicTimeWaitListManager* time_wait_list_manager() {
return time_wait_list_manager_.get();
}
@@ -288,13 +285,6 @@ class QUIC_NO_EXPORT QuicDispatcher
// true if packet is successfully dispatched.
virtual bool OnFailedToDispatchPacket(const ReceivedPacketInfo& packet_info);
- // Called when a new connection starts to be handled by this dispatcher.
- // Either this connection is created or its packets is buffered while waiting
- // for CHLO. Returns true if a new connection should be created or its packets
- // should be buffered, false otherwise.
- virtual bool ShouldCreateOrBufferPacketForConnection(
- const ReceivedPacketInfo& packet_info);
-
bool HasBufferedPackets(QuicConnectionId server_connection_id);
// Called when BufferEarlyPacket() fail to buffer the packet.
@@ -370,15 +360,26 @@ class QUIC_NO_EXPORT QuicDispatcher
// ProcessValidatedPacketWithUnknownConnectionId.
void ProcessHeader(ReceivedPacketInfo* packet_info);
+ struct ExtractChloResult {
+ // If set, a full client hello has been successfully parsed.
+ absl::optional<ParsedClientHello> parsed_chlo;
+ // If set, the TLS alert that will cause a connection close.
+ // Always empty for Google QUIC.
+ absl::optional<uint8_t> tls_alert;
+ };
+
// Try to extract information(sni, alpns, ...) if the full Client Hello has
// been parsed.
//
- // Return the parsed client hello if the full Client Hello has been
- // successfully parsed.
+ // Returns the parsed client hello in ExtractChloResult.parsed_chlo, if the
+ // full Client Hello has been successfully parsed.
+ //
+ // Returns the TLS alert in ExtractChloResult.tls_alert, if the extraction of
+ // Client Hello failed due to that alert.
//
- // Otherwise return absl::nullopt and either buffer or (rarely) drop the
- // packet.
- absl::optional<ParsedClientHello> TryExtractChloOrBufferEarlyPacket(
+ // Otherwise returns a default-constructed ExtractChloResult and either buffer
+ // or (rarely) drop the packet.
+ ExtractChloResult TryExtractChloOrBufferEarlyPacket(
const ReceivedPacketInfo& packet_info);
// Deliver |packets| to |session| for further processing.
@@ -389,6 +390,13 @@ class QUIC_NO_EXPORT QuicDispatcher
// Returns true if |version| is a supported protocol version.
bool IsSupportedVersion(const ParsedQuicVersion version);
+ // Core CHLO processing logic.
+ std::shared_ptr<QuicSession> CreateSessionFromChlo(
+ const QuicConnectionId original_connection_id,
+ const ParsedClientHello& parsed_chlo, const ParsedQuicVersion version,
+ const QuicSocketAddress self_address,
+ const QuicSocketAddress peer_address);
+
const QuicConfig* config_;
const QuicCryptoServerConfig* crypto_config_;
@@ -467,6 +475,9 @@ class QUIC_NO_EXPORT QuicDispatcher
// If true, change expected_server_connection_id_length_ to be the received
// destination connection ID length of all IETF long headers.
bool should_update_expected_server_connection_id_length_;
+
+ const bool send_connection_close_for_tls_alerts_ =
+ GetQuicRestartFlag(quic_dispatcher_send_connection_close_for_tls_alerts);
};
} // namespace quic