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

Side by Side Diff: net/quic/quic_framer.cc

Issue 1543703002: Drop packets which are larger than kMaxPacketSize, instead of closing the connection with QUIC_PACK… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@110286048
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_framer_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_framer.h" 5 #include "net/quic/quic_framer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 DLOG(WARNING) << "Unable to process packet header. Stopping parsing."; 595 DLOG(WARNING) << "Unable to process packet header. Stopping parsing.";
596 return false; 596 return false;
597 } 597 }
598 598
599 if (!visitor_->OnPacketHeader(header)) { 599 if (!visitor_->OnPacketHeader(header)) {
600 // The visitor suppresses further processing of the packet. 600 // The visitor suppresses further processing of the packet.
601 return true; 601 return true;
602 } 602 }
603 603
604 if (packet.length() > kMaxPacketSize) { 604 if (packet.length() > kMaxPacketSize) {
605 DLOG(WARNING) << "Packet too large: " << packet.length(); 605 // If the packet has gotten this far, it should not be too large.
606 LOG(DFATAL) << "Packet too large:" << packet.length();
606 return RaiseError(QUIC_PACKET_TOO_LARGE); 607 return RaiseError(QUIC_PACKET_TOO_LARGE);
607 } 608 }
608 609
609 // Handle the payload. 610 // Handle the payload.
610 if (!header.fec_flag) { 611 if (!header.fec_flag) {
611 if (header.is_in_fec_group == IN_FEC_GROUP) { 612 if (header.is_in_fec_group == IN_FEC_GROUP) {
612 StringPiece payload = reader.PeekRemainingPayload(); 613 StringPiece payload = reader.PeekRemainingPayload();
613 visitor_->OnFecProtectedPayload(payload); 614 visitor_->OnFecProtectedPayload(payload);
614 } 615 }
615 if (!ProcessFrameData(&reader, header)) { 616 if (!ProcessFrameData(&reader, header)) {
(...skipping 1599 matching lines...) Expand 10 before | Expand all | Expand 10 after
2215 2216
2216 bool QuicFramer::RaiseError(QuicErrorCode error) { 2217 bool QuicFramer::RaiseError(QuicErrorCode error) {
2217 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error) 2218 DVLOG(1) << "Error: " << QuicUtils::ErrorToString(error)
2218 << " detail: " << detailed_error_; 2219 << " detail: " << detailed_error_;
2219 set_error(error); 2220 set_error(error);
2220 visitor_->OnError(this); 2221 visitor_->OnError(this);
2221 return false; 2222 return false;
2222 } 2223 }
2223 2224
2224 } // namespace net 2225 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698