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

Unified Diff: net/tools/quic/quic_dispatcher.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_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_dispatcher.h
diff --git a/net/tools/quic/quic_dispatcher.h b/net/tools/quic/quic_dispatcher.h
index 33d8777d3afef6df56f991c733ea48b1c1a0fd7c..40372e43fe1ae4b833b00e739514e6e4640af0d7 100644
--- a/net/tools/quic/quic_dispatcher.h
+++ b/net/tools/quic/quic_dispatcher.h
@@ -20,16 +20,18 @@
#include "net/quic/core/quic_blocked_writer_interface.h"
#include "net/quic/core/quic_buffered_packet_store.h"
#include "net/quic/core/quic_connection.h"
+#include "net/quic/core/quic_crypto_server_stream.h"
#include "net/quic/core/quic_protocol.h"
#include "net/quic/core/quic_server_session_base.h"
+
#include "net/tools/quic/quic_process_packet_interface.h"
#include "net/tools/quic/quic_time_wait_list_manager.h"
+#include "net/tools/quic/stateless_rejector.h"
namespace net {
class QuicConfig;
class QuicCryptoServerConfig;
-class QuicServerSessionBase;
namespace test {
class QuicDispatcherPeer;
@@ -51,7 +53,7 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
const QuicCryptoServerConfig* crypto_config,
QuicVersionManager* version_manager,
std::unique_ptr<QuicConnectionHelperInterface> helper,
- std::unique_ptr<QuicServerSessionBase::Helper> session_helper,
+ std::unique_ptr<QuicCryptoServerStream::Helper> session_helper,
std::unique_ptr<QuicAlarmFactory> alarm_factory);
~QuicDispatcher() override;
@@ -87,6 +89,9 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
// time-wait list.
void OnConnectionAddedToTimeWaitList(QuicConnectionId connection_id) override;
+ void OnPacketBeingDispatchedToSession(
+ QuicServerSessionBase* session) override {}
+
typedef std::unordered_map<QuicConnectionId, QuicServerSessionBase*>
SessionMap;
@@ -222,7 +227,7 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
QuicConnectionHelperInterface* helper() { return helper_.get(); }
- QuicServerSessionBase::Helper* session_helper() {
+ QuicCryptoServerStream::Helper* session_helper() {
return session_helper_.get();
}
@@ -263,6 +268,7 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
private:
friend class net::test::QuicDispatcherPeer;
+ friend class StatelessRejectorProcessDoneCallback;
// Removes the session from the session map and write blocked list, and adds
// the ConnectionId to the time-wait list. If |session_closed_statelessly| is
@@ -272,17 +278,29 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
bool HandlePacketForTimeWait(const QuicPacketPublicHeader& header);
// Attempts to reject the connection statelessly, if stateless rejects are
- // possible and if the current packet contains a CHLO message.
- // Returns a fate which describes what subsequent processing should be
- // performed on the packets, like ValidityChecks.
- QuicPacketFate MaybeRejectStatelessly(QuicConnectionId connection_id,
- const QuicPacketHeader& header);
+ // possible and if the current packet contains a CHLO message. Determines a
+ // fate which describes what subsequent processing should be performed on the
+ // packets, like ValidityChecks, and invokes ProcessUnauthenticatedHeaderFate.
+ void MaybeRejectStatelessly(QuicConnectionId connection_id,
+ const QuicPacketHeader& header);
// Deliver |packets| to |session| for further processing.
void DeliverPacketsToSession(
const std::list<QuicBufferedPacketStore::BufferedPacket>& packets,
QuicServerSessionBase* session);
+ // Perform the appropriate actions on the current packet based on |fate| -
+ // either process, buffer, or drop it.
+ void ProcessUnauthenticatedHeaderFate(QuicPacketFate fate,
+ QuicConnectionId connection_id,
+ QuicPacketNumber packet_number);
+
+ // Invoked when StatelessRejector::Process completes.
+ void OnStatelessRejectorProcessDone(
+ std::unique_ptr<StatelessRejector> rejector,
+ QuicPacketNumber packet_number,
+ QuicVersion first_version);
+
void set_new_sessions_allowed_per_event_loop(
int16_t new_sessions_allowed_per_event_loop) {
new_sessions_allowed_per_event_loop_ = new_sessions_allowed_per_event_loop;
@@ -310,7 +328,7 @@ class QuicDispatcher : public QuicServerSessionBase::Visitor,
std::unique_ptr<QuicConnectionHelperInterface> helper_;
// The helper used for all sessions.
- std::unique_ptr<QuicServerSessionBase::Helper> session_helper_;
+ std::unique_ptr<QuicCryptoServerStream::Helper> session_helper_;
// Creates alarms.
std::unique_ptr<QuicAlarmFactory> alarm_factory_;
« no previous file with comments | « net/tools/quic/quic_default_packet_writer.h ('k') | net/tools/quic/quic_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698