Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(755)

Unified Diff: net/tools/quic/stateless_rejector.h

Issue 2322233004: Landing Recent QUIC changes until Sun Sep 4 03:41:00 (Closed)
Patch Set: Remove simulation files from the build. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_time_wait_list_manager.h ('k') | net/tools/quic/stateless_rejector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/stateless_rejector.h
diff --git a/net/tools/quic/stateless_rejector.h b/net/tools/quic/stateless_rejector.h
index 39c03a1d896cdfdf906fc1089bc31fd04366614d..b092f957edba2293000c690fa80b139704c6917b 100644
--- a/net/tools/quic/stateless_rejector.h
+++ b/net/tools/quic/stateless_rejector.h
@@ -17,6 +17,7 @@ namespace net {
class StatelessRejector {
public:
enum State {
+ UNKNOWN, // State has not yet been determined
UNSUPPORTED, // Stateless rejects are not supported
FAILED, // There was an error processing the CHLO.
ACCEPTED, // The CHLO was accepted
@@ -35,13 +36,24 @@ class StatelessRejector {
~StatelessRejector();
- // Called when |chlo| is received for |connection_id| to determine
- // if it should be statelessly rejected.
+ // Called when |chlo| is received for |connection_id|.
void OnChlo(QuicVersion version,
QuicConnectionId connection_id,
QuicConnectionId server_designated_connection_id,
const CryptoHandshakeMessage& chlo);
+ class ProcessDoneCallback {
+ public:
+ virtual ~ProcessDoneCallback() = default;
+ virtual void Run(std::unique_ptr<StatelessRejector> rejector) = 0;
+ };
+
+ // Perform processing to determine whether the CHLO received in OnChlo should
+ // be statelessly rejected, and invoke the callback once a decision has been
+ // made.
+ static void Process(std::unique_ptr<StatelessRejector> rejector,
+ std::unique_ptr<ProcessDoneCallback> cb);
+
// Returns the state of the rejector after OnChlo() has been called.
State state() const { return state_; }
@@ -51,6 +63,9 @@ class StatelessRejector {
// Returns the error details when state() returns FAILED.
std::string error_details() const { return error_details_; }
+ // Returns the connection ID.
+ QuicConnectionId connection_id() const { return connection_id_; }
+
// Returns the SREJ message when state() returns REJECTED.
const CryptoHandshakeMessage& reply() const { return reply_; }
@@ -62,7 +77,9 @@ class StatelessRejector {
void ProcessClientHello(
const CryptoHandshakeMessage& client_hello,
- const ValidateClientHelloResultCallback::Result& result);
+ const ValidateClientHelloResultCallback::Result& result,
+ std::unique_ptr<StatelessRejector> rejector,
+ std::unique_ptr<StatelessRejector::ProcessDoneCallback> cb);
State state_;
QuicErrorCode error_;
@@ -78,7 +95,7 @@ class StatelessRejector {
QuicRandom* random_;
const QuicCryptoServerConfig* crypto_config_;
QuicCompressedCertsCache* compressed_certs_cache_;
- const CryptoHandshakeMessage* chlo_;
+ CryptoHandshakeMessage chlo_;
CryptoHandshakeMessage reply_;
CryptoFramer crypto_framer_;
QuicCryptoProof proof_;
« no previous file with comments | « net/tools/quic/quic_time_wait_list_manager.h ('k') | net/tools/quic/stateless_rejector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698