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 1459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1470 } | 1470 } |
1471 } | 1471 } |
1472 | 1472 |
1473 bool QuicConnection::ProcessValidatedPacket() { | 1473 bool QuicConnection::ProcessValidatedPacket() { |
1474 if (self_ip_changed_ || self_port_changed_) { | 1474 if (self_ip_changed_ || self_port_changed_) { |
1475 SendConnectionCloseWithDetails(QUIC_ERROR_MIGRATING_ADDRESS, | 1475 SendConnectionCloseWithDetails(QUIC_ERROR_MIGRATING_ADDRESS, |
1476 "Self address migration is not supported."); | 1476 "Self address migration is not supported."); |
1477 return false; | 1477 return false; |
1478 } | 1478 } |
1479 | 1479 |
1480 // TODO(fayang): Use peer_address_changed_ instead of peer_ip_changed_ and | |
1481 // peer_port_changed_ once FLAGS_quic_allow_ip_migration is deprecated. | |
1482 if (peer_ip_changed_ || peer_port_changed_) { | 1480 if (peer_ip_changed_ || peer_port_changed_) { |
1483 IPEndPoint old_peer_address = peer_address_; | 1481 IPEndPoint old_peer_address = peer_address_; |
1484 peer_address_ = IPEndPoint( | 1482 peer_address_ = IPEndPoint( |
1485 peer_ip_changed_ ? migrating_peer_ip_ : peer_address_.address(), | 1483 peer_ip_changed_ ? migrating_peer_ip_ : peer_address_.address(), |
1486 peer_port_changed_ ? migrating_peer_port_ : peer_address_.port()); | 1484 peer_port_changed_ ? migrating_peer_port_ : peer_address_.port()); |
1487 | 1485 |
1488 DVLOG(1) << ENDPOINT << "Peer's ip:port changed from " | 1486 DVLOG(1) << ENDPOINT << "Peer's ip:port changed from " |
1489 << old_peer_address.ToString() << " to " | 1487 << old_peer_address.ToString() << " to " |
1490 << peer_address_.ToString() << ", migrating connection."; | 1488 << peer_address_.ToString() << ", migrating connection."; |
1491 | 1489 |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2453 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2451 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
2454 ++mtu_probe_count_; | 2452 ++mtu_probe_count_; |
2455 | 2453 |
2456 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2454 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
2457 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2455 SendMtuDiscoveryPacket(mtu_discovery_target_); |
2458 | 2456 |
2459 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2457 DCHECK(!mtu_discovery_alarm_->IsSet()); |
2460 } | 2458 } |
2461 | 2459 |
2462 } // namespace net | 2460 } // namespace net |
OLD | NEW |