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 1597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 return false; | 1608 return false; |
1609 } | 1609 } |
1610 delete packet->serialized_packet.retransmittable_frames; | 1610 delete packet->serialized_packet.retransmittable_frames; |
1611 delete packet->serialized_packet.packet; | 1611 delete packet->serialized_packet.packet; |
1612 packet->serialized_packet.retransmittable_frames = nullptr; | 1612 packet->serialized_packet.retransmittable_frames = nullptr; |
1613 packet->serialized_packet.packet = nullptr; | 1613 packet->serialized_packet.packet = nullptr; |
1614 return true; | 1614 return true; |
1615 } | 1615 } |
1616 | 1616 |
1617 bool QuicConnection::WritePacketInner(QueuedPacket* packet) { | 1617 bool QuicConnection::WritePacketInner(QueuedPacket* packet) { |
| 1618 if (FLAGS_quic_close_connection_out_of_order_sending && |
| 1619 packet->serialized_packet.packet_number < |
| 1620 sent_packet_manager_.largest_sent_packet()) { |
| 1621 LOG(DFATAL) << "Attempt to write packet:" |
| 1622 << packet->serialized_packet.packet_number |
| 1623 << " after:" << sent_packet_manager_.largest_sent_packet(); |
| 1624 SendConnectionCloseWithDetails(QUIC_INTERNAL_ERROR, |
| 1625 "Packet written out of order."); |
| 1626 return true; |
| 1627 } |
1618 if (ShouldDiscardPacket(*packet)) { | 1628 if (ShouldDiscardPacket(*packet)) { |
1619 ++stats_.packets_discarded; | 1629 ++stats_.packets_discarded; |
1620 return true; | 1630 return true; |
1621 } | 1631 } |
1622 // Connection close packets are encrypted and saved, so don't exit early. | 1632 // Connection close packets are encrypted and saved, so don't exit early. |
1623 const bool is_connection_close = IsConnectionClose(*packet); | 1633 const bool is_connection_close = IsConnectionClose(*packet); |
1624 if (writer_->IsWriteBlocked() && !is_connection_close) { | 1634 if (writer_->IsWriteBlocked() && !is_connection_close) { |
1625 return false; | 1635 return false; |
1626 } | 1636 } |
1627 | 1637 |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2396 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2406 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
2397 ++mtu_probe_count_; | 2407 ++mtu_probe_count_; |
2398 | 2408 |
2399 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2409 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
2400 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2410 SendMtuDiscoveryPacket(mtu_discovery_target_); |
2401 | 2411 |
2402 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2412 DCHECK(!mtu_discovery_alarm_->IsSet()); |
2403 } | 2413 } |
2404 | 2414 |
2405 } // namespace net | 2415 } // namespace net |
OLD | NEW |