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

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

Issue 908623002: Revert of Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_flags.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_dispatcher.h" 5 #include "net/quic/quic_dispatcher.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // in OnAuthenticatedHeader. 197 // in OnAuthenticatedHeader.
198 framer_.ProcessPacket(packet); 198 framer_.ProcessPacket(packet);
199 // TODO(rjshade): Return a status describing if/why a packet was dropped, 199 // TODO(rjshade): Return a status describing if/why a packet was dropped,
200 // and log somehow. Maybe expose as a varz. 200 // and log somehow. Maybe expose as a varz.
201 } 201 }
202 202
203 bool QuicDispatcher::OnUnauthenticatedPublicHeader( 203 bool QuicDispatcher::OnUnauthenticatedPublicHeader(
204 const QuicPacketPublicHeader& header) { 204 const QuicPacketPublicHeader& header) {
205 QuicSession* session = nullptr; 205 QuicSession* session = nullptr;
206 206
207 // Port zero is only allowed for unidirectional UDP, so is disallowed by QUIC.
208 // Given that we can't even send a reply rejecting the packet, just black hole
209 // it.
210 if (current_client_address_.port() == 0) {
211 return false;
212 }
213
214 QuicConnectionId connection_id = header.connection_id; 207 QuicConnectionId connection_id = header.connection_id;
215 SessionMap::iterator it = session_map_.find(connection_id); 208 SessionMap::iterator it = session_map_.find(connection_id);
216 if (it == session_map_.end()) { 209 if (it == session_map_.end()) {
217 if (header.reset_flag) { 210 if (header.reset_flag) {
218 return false; 211 return false;
219 } 212 }
220 if (time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)) { 213 if (time_wait_list_manager_->IsConnectionIdInTimeWait(connection_id)) {
221 return HandlePacketForTimeWait(header); 214 return HandlePacketForTimeWait(header);
222 } 215 }
223 216
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 // be parsed correctly. 392 // be parsed correctly.
400 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId( 393 framer_.set_version(time_wait_list_manager_->GetQuicVersionFromConnectionId(
401 header.connection_id)); 394 header.connection_id));
402 395
403 // Continue parsing the packet to extract the sequence number. Then 396 // Continue parsing the packet to extract the sequence number. Then
404 // send it to the time wait manager in OnUnathenticatedHeader. 397 // send it to the time wait manager in OnUnathenticatedHeader.
405 return true; 398 return true;
406 } 399 }
407 400
408 } // namespace net 401 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_flags.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698