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/core/quic_connection.h" | 5 #include "net/quic/core/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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 } | 1306 } |
1307 | 1307 |
1308 if (!Near(header.packet_number, last_header_.packet_number)) { | 1308 if (!Near(header.packet_number, last_header_.packet_number)) { |
1309 QUIC_DLOG(INFO) << ENDPOINT << "Packet " << header.packet_number | 1309 QUIC_DLOG(INFO) << ENDPOINT << "Packet " << header.packet_number |
1310 << " out of bounds. Discarding"; | 1310 << " out of bounds. Discarding"; |
1311 CloseConnection(QUIC_INVALID_PACKET_HEADER, "Packet number out of bounds.", | 1311 CloseConnection(QUIC_INVALID_PACKET_HEADER, "Packet number out of bounds.", |
1312 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 1312 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
1313 return false; | 1313 return false; |
1314 } | 1314 } |
1315 | 1315 |
1316 // Multipath is not enabled, but a packet with multipath flag on is | |
1317 // received. | |
1318 if (header.public_header.multipath_flag) { | |
1319 const string error_details = | |
1320 "Received a packet with multipath flag but multipath is not enabled."; | |
1321 QUIC_BUG << error_details; | |
1322 CloseConnection(QUIC_BAD_MULTIPATH_FLAG, error_details, | |
1323 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | |
1324 return false; | |
1325 } | |
1326 | |
1327 if (version_negotiation_state_ != NEGOTIATED_VERSION) { | 1316 if (version_negotiation_state_ != NEGOTIATED_VERSION) { |
1328 if (perspective_ == Perspective::IS_SERVER) { | 1317 if (perspective_ == Perspective::IS_SERVER) { |
1329 if (!header.public_header.version_flag) { | 1318 if (!header.public_header.version_flag) { |
1330 // Packets should have the version flag till version negotiation is | 1319 // Packets should have the version flag till version negotiation is |
1331 // done. | 1320 // done. |
1332 string error_details = | 1321 string error_details = |
1333 QuicStrCat(ENDPOINT, "Packet ", header.packet_number, | 1322 QuicStrCat(ENDPOINT, "Packet ", header.packet_number, |
1334 " without version flag before version negotiated."); | 1323 " without version flag before version negotiated."); |
1335 QUIC_DLOG(WARNING) << error_details; | 1324 QUIC_DLOG(WARNING) << error_details; |
1336 CloseConnection(QUIC_INVALID_VERSION, error_details, | 1325 CloseConnection(QUIC_INVALID_VERSION, error_details, |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 | 2425 |
2437 void QuicConnection::CheckIfApplicationLimited() { | 2426 void QuicConnection::CheckIfApplicationLimited() { |
2438 if (queued_packets_.empty() && | 2427 if (queued_packets_.empty() && |
2439 !sent_packet_manager_.HasPendingRetransmissions() && | 2428 !sent_packet_manager_.HasPendingRetransmissions() && |
2440 !visitor_->WillingAndAbleToWrite()) { | 2429 !visitor_->WillingAndAbleToWrite()) { |
2441 sent_packet_manager_.OnApplicationLimited(); | 2430 sent_packet_manager_.OnApplicationLimited(); |
2442 } | 2431 } |
2443 } | 2432 } |
2444 | 2433 |
2445 } // namespace net | 2434 } // namespace net |
OLD | NEW |