OLD | NEW |
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/tools/quic/quic_dispatcher.h" | 5 #include "net/tools/quic/quic_dispatcher.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 | 197 |
198 void QuicDispatcher::ProcessPacket(const IPEndPoint& server_address, | 198 void QuicDispatcher::ProcessPacket(const IPEndPoint& server_address, |
199 const IPEndPoint& client_address, | 199 const IPEndPoint& client_address, |
200 const QuicEncryptedPacket& packet) { | 200 const QuicEncryptedPacket& packet) { |
201 current_server_address_ = server_address; | 201 current_server_address_ = server_address; |
202 current_client_address_ = client_address; | 202 current_client_address_ = client_address; |
203 current_packet_ = &packet; | 203 current_packet_ = &packet; |
204 // ProcessPacket will cause the packet to be dispatched in | 204 // ProcessPacket will cause the packet to be dispatched in |
205 // OnUnauthenticatedPublicHeader, or sent to the time wait list manager | 205 // OnUnauthenticatedPublicHeader, or sent to the time wait list manager |
206 // in OnAuthenticatedHeader. | 206 // in OnUnauthenticatedHeader. |
207 framer_.ProcessPacket(packet); | 207 framer_.ProcessPacket(packet); |
208 // TODO(rjshade): Return a status describing if/why a packet was dropped, | 208 // TODO(rjshade): Return a status describing if/why a packet was dropped, |
209 // and log somehow. Maybe expose as a varz. | 209 // and log somehow. Maybe expose as a varz. |
210 } | 210 } |
211 | 211 |
212 bool QuicDispatcher::OnUnauthenticatedPublicHeader( | 212 bool QuicDispatcher::OnUnauthenticatedPublicHeader( |
213 const QuicPacketPublicHeader& header) { | 213 const QuicPacketPublicHeader& header) { |
214 // Port zero is only allowed for unidirectional UDP, so is disallowed by QUIC. | 214 // Port zero is only allowed for unidirectional UDP, so is disallowed by QUIC. |
215 // Given that we can't even send a reply rejecting the packet, just drop the | 215 // Given that we can't even send a reply rejecting the packet, just drop the |
216 // packet. | 216 // packet. |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 // send it to the time wait manager in OnUnathenticatedHeader. | 484 // send it to the time wait manager in OnUnathenticatedHeader. |
485 return true; | 485 return true; |
486 } | 486 } |
487 | 487 |
488 void QuicDispatcher::SetLastError(QuicErrorCode error) { | 488 void QuicDispatcher::SetLastError(QuicErrorCode error) { |
489 last_error_ = error; | 489 last_error_ = error; |
490 } | 490 } |
491 | 491 |
492 } // namespace tools | 492 } // namespace tools |
493 } // namespace net | 493 } // namespace net |
OLD | NEW |