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/quic/quic_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 } | 1456 } |
1457 } | 1457 } |
1458 | 1458 |
1459 bool QuicConnection::ProcessValidatedPacket() { | 1459 bool QuicConnection::ProcessValidatedPacket() { |
1460 if (self_ip_changed_ || self_port_changed_) { | 1460 if (self_ip_changed_ || self_port_changed_) { |
1461 SendConnectionCloseWithDetails(QUIC_ERROR_MIGRATING_ADDRESS, | 1461 SendConnectionCloseWithDetails(QUIC_ERROR_MIGRATING_ADDRESS, |
1462 "Self address migration is not supported."); | 1462 "Self address migration is not supported."); |
1463 return false; | 1463 return false; |
1464 } | 1464 } |
1465 | 1465 |
1466 // TODO(fayang): Use peer_address_changed_ instead of peer_ip_changed_ and | |
1467 // peer_port_changed_ once FLAGS_quic_allow_ip_migration is deprecated. | |
1468 if (peer_ip_changed_ || peer_port_changed_) { | 1466 if (peer_ip_changed_ || peer_port_changed_) { |
1469 IPEndPoint old_peer_address = peer_address_; | 1467 IPEndPoint old_peer_address = peer_address_; |
1470 peer_address_ = IPEndPoint( | 1468 peer_address_ = IPEndPoint( |
1471 peer_ip_changed_ ? migrating_peer_ip_ : peer_address_.address(), | 1469 peer_ip_changed_ ? migrating_peer_ip_ : peer_address_.address(), |
1472 peer_port_changed_ ? migrating_peer_port_ : peer_address_.port()); | 1470 peer_port_changed_ ? migrating_peer_port_ : peer_address_.port()); |
1473 | 1471 |
1474 DVLOG(1) << ENDPOINT << "Peer's ip:port changed from " | 1472 DVLOG(1) << ENDPOINT << "Peer's ip:port changed from " |
1475 << old_peer_address.ToString() << " to " | 1473 << old_peer_address.ToString() << " to " |
1476 << peer_address_.ToString() << ", migrating connection."; | 1474 << peer_address_.ToString() << ", migrating connection."; |
1477 | 1475 |
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2404 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2402 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
2405 ++mtu_probe_count_; | 2403 ++mtu_probe_count_; |
2406 | 2404 |
2407 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2405 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
2408 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2406 SendMtuDiscoveryPacket(mtu_discovery_target_); |
2409 | 2407 |
2410 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2408 DCHECK(!mtu_discovery_alarm_->IsSet()); |
2411 } | 2409 } |
2412 | 2410 |
2413 } // namespace net | 2411 } // namespace net |
OLD | NEW |