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

Unified Diff: net/quic/quic_framer.cc

Issue 123303003: Move all the packet parsing logic into QuicDispatcher from the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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/quic/quic_framer.h ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_framer.cc
diff --git a/net/quic/quic_framer.cc b/net/quic/quic_framer.cc
index 9ca8a3dcf01819ce58c64ee64277e8206cf5404b..3dd72b90d9340748f26f9e2e5a7a7e35143cc511 100644
--- a/net/quic/quic_framer.cc
+++ b/net/quic/quic_framer.cc
@@ -482,6 +482,12 @@ bool QuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) {
return RaiseError(QUIC_INVALID_PACKET_HEADER);
}
+ if (!visitor_->OnUnauthenticatedPublicHeader(public_header)) {
+ // The visitor suppresses further processing of the packet.
+ reader_.reset(NULL);
+ return true;
+ }
+
if (is_server_ && public_header.version_flag &&
public_header.versions[0] != quic_version_) {
if (!visitor_->OnProtocolVersionMismatch(public_header.versions[0])) {
@@ -813,23 +819,6 @@ bool QuicFramer::ProcessPublicHeader(
}
// static
-bool QuicFramer::ReadGuidFromPacket(const QuicEncryptedPacket& packet,
- QuicGuid* guid) {
- QuicDataReader reader(packet.data(), packet.length());
- uint8 public_flags;
- if (!reader.ReadBytes(&public_flags, 1)) {
- return false;
- }
- // Ensure it's an 8 byte guid.
- if ((public_flags & PACKET_PUBLIC_FLAGS_8BYTE_GUID) !=
- PACKET_PUBLIC_FLAGS_8BYTE_GUID) {
- return false;
- }
-
- return reader.ReadUInt64(guid);
-}
-
-// static
QuicSequenceNumberLength QuicFramer::GetMinSequenceNumberLength(
QuicPacketSequenceNumber sequence_number) {
if (sequence_number < 1 << (PACKET_1BYTE_SEQUENCE_NUMBER * 8)) {
@@ -1768,11 +1757,6 @@ bool QuicFramer::AppendStreamFramePayload(
}
// static
-bool QuicFramer::HasVersionFlag(const QuicEncryptedPacket& packet) {
- return packet.length() > 0 &&
- (packet.data()[0] & PACKET_PUBLIC_FLAGS_VERSION) != 0;
-}
-
void QuicFramer::set_version(const QuicVersion version) {
DCHECK(IsSupportedVersion(version));
quic_version_ = version;
« no previous file with comments | « net/quic/quic_framer.h ('k') | net/quic/quic_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698