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 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 if (!writer_->IsWriteBlocked()) { | 1197 if (!writer_->IsWriteBlocked()) { |
1198 OnCanWrite(); | 1198 OnCanWrite(); |
1199 } | 1199 } |
1200 } | 1200 } |
1201 | 1201 |
1202 bool QuicConnection::ProcessValidatedPacket() { | 1202 bool QuicConnection::ProcessValidatedPacket() { |
1203 if ((!FLAGS_quic_allow_port_migration && peer_port_changed_) || | 1203 if ((!FLAGS_quic_allow_port_migration && peer_port_changed_) || |
1204 peer_ip_changed_ || self_ip_changed_ || self_port_changed_) { | 1204 peer_ip_changed_ || self_ip_changed_ || self_port_changed_) { |
1205 SendConnectionCloseWithDetails( | 1205 SendConnectionCloseWithDetails( |
1206 QUIC_ERROR_MIGRATING_ADDRESS, | 1206 QUIC_ERROR_MIGRATING_ADDRESS, |
1207 "IP or port migration is not yet a supported feature"); | 1207 "Neither IP address migration, nor self port migration are supported."); |
1208 return false; | 1208 return false; |
1209 } | 1209 } |
1210 | 1210 |
1211 // Port migration is supported, do it now if port has changed. | 1211 // Port migration is supported, do it now if port has changed. |
1212 if (FLAGS_quic_allow_port_migration && | 1212 if (FLAGS_quic_allow_port_migration && |
1213 peer_port_changed_) { | 1213 peer_port_changed_) { |
1214 DVLOG(1) << ENDPOINT << "Peer's port changed from " | 1214 DVLOG(1) << ENDPOINT << "Peer's port changed from " |
1215 << peer_address_.port() << " to " << migrating_peer_port_ | 1215 << peer_address_.port() << " to " << migrating_peer_port_ |
1216 << ", migrating connection."; | 1216 << ", migrating connection."; |
1217 peer_address_ = IPEndPoint(peer_address_.address(), migrating_peer_port_); | 1217 peer_address_ = IPEndPoint(peer_address_.address(), migrating_peer_port_); |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1989 // If we changed the generator's batch state, restore original batch state. | 1989 // If we changed the generator's batch state, restore original batch state. |
1990 if (!already_in_batch_mode_) { | 1990 if (!already_in_batch_mode_) { |
1991 DVLOG(1) << "Leaving Batch Mode."; | 1991 DVLOG(1) << "Leaving Batch Mode."; |
1992 connection_->packet_generator_.FinishBatchOperations(); | 1992 connection_->packet_generator_.FinishBatchOperations(); |
1993 } | 1993 } |
1994 DCHECK_EQ(already_in_batch_mode_, | 1994 DCHECK_EQ(already_in_batch_mode_, |
1995 connection_->packet_generator_.InBatchMode()); | 1995 connection_->packet_generator_.InBatchMode()); |
1996 } | 1996 } |
1997 | 1997 |
1998 } // namespace net | 1998 } // namespace net |
OLD | NEW |