| 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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 367 } |
| 368 if (config.HasClientSentConnectionOption(kAKD3, perspective_)) { | 368 if (config.HasClientSentConnectionOption(kAKD3, perspective_)) { |
| 369 ack_mode_ = ACK_DECIMATION; | 369 ack_mode_ = ACK_DECIMATION; |
| 370 ack_decimation_delay_ = kShortAckDecimationDelay; | 370 ack_decimation_delay_ = kShortAckDecimationDelay; |
| 371 } | 371 } |
| 372 if (config.HasClientSentConnectionOption(kAKD4, perspective_)) { | 372 if (config.HasClientSentConnectionOption(kAKD4, perspective_)) { |
| 373 ack_mode_ = ACK_DECIMATION_WITH_REORDERING; | 373 ack_mode_ = ACK_DECIMATION_WITH_REORDERING; |
| 374 ack_decimation_delay_ = kShortAckDecimationDelay; | 374 ack_decimation_delay_ = kShortAckDecimationDelay; |
| 375 } | 375 } |
| 376 if (config.HasClientSentConnectionOption(k5RTO, perspective_)) { | 376 if (config.HasClientSentConnectionOption(k5RTO, perspective_)) { |
| 377 close_connection_after_five_rtos_ = true; | 377 if (perspective_ == Perspective::IS_CLIENT || |
| 378 !FLAGS_quic_only_5rto_client_side) { |
| 379 close_connection_after_five_rtos_ = true; |
| 380 } |
| 378 } | 381 } |
| 379 } | 382 } |
| 380 | 383 |
| 381 void QuicConnection::OnSendConnectionState( | 384 void QuicConnection::OnSendConnectionState( |
| 382 const CachedNetworkParameters& cached_network_params) { | 385 const CachedNetworkParameters& cached_network_params) { |
| 383 if (debug_visitor_ != nullptr) { | 386 if (debug_visitor_ != nullptr) { |
| 384 debug_visitor_->OnSendConnectionState(cached_network_params); | 387 debug_visitor_->OnSendConnectionState(cached_network_params); |
| 385 } | 388 } |
| 386 } | 389 } |
| 387 | 390 |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 bool QuicConnection::OnUnauthenticatedHeader(const QuicPacketHeader& header) { | 589 bool QuicConnection::OnUnauthenticatedHeader(const QuicPacketHeader& header) { |
| 587 if (debug_visitor_ != nullptr) { | 590 if (debug_visitor_ != nullptr) { |
| 588 debug_visitor_->OnUnauthenticatedHeader(header); | 591 debug_visitor_->OnUnauthenticatedHeader(header); |
| 589 } | 592 } |
| 590 | 593 |
| 591 // Check that any public reset packet with a different connection ID that was | 594 // Check that any public reset packet with a different connection ID that was |
| 592 // routed to this QuicConnection has been redirected before control reaches | 595 // routed to this QuicConnection has been redirected before control reaches |
| 593 // here. | 596 // here. |
| 594 DCHECK_EQ(connection_id_, header.public_header.connection_id); | 597 DCHECK_EQ(connection_id_, header.public_header.connection_id); |
| 595 | 598 |
| 596 if (!FLAGS_quic_postpone_multipath_flag_validation) { | |
| 597 // Multipath is not enabled, but a packet with multipath flag on is | |
| 598 // received. | |
| 599 if (!multipath_enabled_ && header.public_header.multipath_flag) { | |
| 600 const string error_details = | |
| 601 "Received a packet with multipath flag but multipath is not enabled."; | |
| 602 QUIC_BUG << error_details; | |
| 603 CloseConnection(QUIC_BAD_MULTIPATH_FLAG, error_details, | |
| 604 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | |
| 605 return false; | |
| 606 } | |
| 607 } | |
| 608 if (!packet_generator_.IsPendingPacketEmpty()) { | 599 if (!packet_generator_.IsPendingPacketEmpty()) { |
| 609 // Incoming packets may change a queued ACK frame. | 600 // Incoming packets may change a queued ACK frame. |
| 610 const string error_details = | 601 const string error_details = |
| 611 "Pending frames must be serialized before incoming packets are " | 602 "Pending frames must be serialized before incoming packets are " |
| 612 "processed."; | 603 "processed."; |
| 613 QUIC_BUG << error_details; | 604 QUIC_BUG << error_details; |
| 614 CloseConnection(QUIC_INTERNAL_ERROR, error_details, | 605 CloseConnection(QUIC_INTERNAL_ERROR, error_details, |
| 615 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 606 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
| 616 return false; | 607 return false; |
| 617 } | 608 } |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1423 } | 1414 } |
| 1424 | 1415 |
| 1425 if (!Near(header.packet_number, last_header_.packet_number)) { | 1416 if (!Near(header.packet_number, last_header_.packet_number)) { |
| 1426 DVLOG(1) << ENDPOINT << "Packet " << header.packet_number | 1417 DVLOG(1) << ENDPOINT << "Packet " << header.packet_number |
| 1427 << " out of bounds. Discarding"; | 1418 << " out of bounds. Discarding"; |
| 1428 CloseConnection(QUIC_INVALID_PACKET_HEADER, "packet number out of bounds.", | 1419 CloseConnection(QUIC_INVALID_PACKET_HEADER, "packet number out of bounds.", |
| 1429 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 1420 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
| 1430 return false; | 1421 return false; |
| 1431 } | 1422 } |
| 1432 | 1423 |
| 1433 if (FLAGS_quic_postpone_multipath_flag_validation) { | 1424 // Multipath is not enabled, but a packet with multipath flag on is |
| 1434 // Multipath is not enabled, but a packet with multipath flag on is | 1425 // received. |
| 1435 // received. | 1426 if (!multipath_enabled_ && header.public_header.multipath_flag) { |
| 1436 if (!multipath_enabled_ && header.public_header.multipath_flag) { | 1427 const string error_details = |
| 1437 const string error_details = | 1428 "Received a packet with multipath flag but multipath is not enabled."; |
| 1438 "Received a packet with multipath flag but multipath is not enabled."; | 1429 QUIC_BUG << error_details; |
| 1439 QUIC_BUG << error_details; | 1430 CloseConnection(QUIC_BAD_MULTIPATH_FLAG, error_details, |
| 1440 CloseConnection(QUIC_BAD_MULTIPATH_FLAG, error_details, | 1431 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); |
| 1441 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | 1432 return false; |
| 1442 return false; | |
| 1443 } | |
| 1444 } | 1433 } |
| 1445 | 1434 |
| 1446 if (version_negotiation_state_ != NEGOTIATED_VERSION) { | 1435 if (version_negotiation_state_ != NEGOTIATED_VERSION) { |
| 1447 if (perspective_ == Perspective::IS_SERVER) { | 1436 if (perspective_ == Perspective::IS_SERVER) { |
| 1448 if (!header.public_header.version_flag) { | 1437 if (!header.public_header.version_flag) { |
| 1449 // Packets should have the version flag till version negotiation is | 1438 // Packets should have the version flag till version negotiation is |
| 1450 // done. | 1439 // done. |
| 1451 string error_details = | 1440 string error_details = |
| 1452 StringPrintf("%s Packet %" PRIu64 | 1441 StringPrintf("%s Packet %" PRIu64 |
| 1453 " without version flag before version negotiated.", | 1442 " without version flag before version negotiated.", |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1611 ++stats_.packets_discarded; | 1600 ++stats_.packets_discarded; |
| 1612 return true; | 1601 return true; |
| 1613 } | 1602 } |
| 1614 // Termination packets are encrypted and saved, so don't exit early. | 1603 // Termination packets are encrypted and saved, so don't exit early. |
| 1615 const bool is_termination_packet = IsTerminationPacket(*packet); | 1604 const bool is_termination_packet = IsTerminationPacket(*packet); |
| 1616 if (writer_->IsWriteBlocked() && !is_termination_packet) { | 1605 if (writer_->IsWriteBlocked() && !is_termination_packet) { |
| 1617 return false; | 1606 return false; |
| 1618 } | 1607 } |
| 1619 | 1608 |
| 1620 QuicPacketNumber packet_number = packet->packet_number; | 1609 QuicPacketNumber packet_number = packet->packet_number; |
| 1610 // TODO(ianswett): Remove packet_number_of_last_sent_packet_ because it's |
| 1611 // redundant to SentPacketManager_->GetLargestPacket in most cases, and wrong |
| 1612 // for multipath. |
| 1621 DCHECK_LE(packet_number_of_last_sent_packet_, packet_number); | 1613 DCHECK_LE(packet_number_of_last_sent_packet_, packet_number); |
| 1622 packet_number_of_last_sent_packet_ = packet_number; | 1614 packet_number_of_last_sent_packet_ = packet_number; |
| 1623 | 1615 |
| 1624 QuicPacketLength encrypted_length = packet->encrypted_length; | 1616 QuicPacketLength encrypted_length = packet->encrypted_length; |
| 1625 // Termination packets are eventually owned by TimeWaitListManager. | 1617 // Termination packets are eventually owned by TimeWaitListManager. |
| 1626 // Others are deleted at the end of this call. | 1618 // Others are deleted at the end of this call. |
| 1627 if (is_termination_packet) { | 1619 if (is_termination_packet) { |
| 1628 if (termination_packets_.get() == nullptr) { | 1620 if (termination_packets_.get() == nullptr) { |
| 1629 termination_packets_.reset( | 1621 termination_packets_.reset( |
| 1630 new std::vector<std::unique_ptr<QuicEncryptedPacket>>); | 1622 new std::vector<std::unique_ptr<QuicEncryptedPacket>>); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1668 if (result.status == WRITE_STATUS_BLOCKED) { | 1660 if (result.status == WRITE_STATUS_BLOCKED) { |
| 1669 visitor_->OnWriteBlocked(); | 1661 visitor_->OnWriteBlocked(); |
| 1670 // If the socket buffers the the data, then the packet should not | 1662 // If the socket buffers the the data, then the packet should not |
| 1671 // be queued and sent again, which would result in an unnecessary | 1663 // be queued and sent again, which would result in an unnecessary |
| 1672 // duplicate packet being sent. The helper must call OnCanWrite | 1664 // duplicate packet being sent. The helper must call OnCanWrite |
| 1673 // when the write completes, and OnWriteError if an error occurs. | 1665 // when the write completes, and OnWriteError if an error occurs. |
| 1674 if (!writer_->IsWriteBlockedDataBuffered()) { | 1666 if (!writer_->IsWriteBlockedDataBuffered()) { |
| 1675 return false; | 1667 return false; |
| 1676 } | 1668 } |
| 1677 } | 1669 } |
| 1670 |
| 1671 if (FLAGS_quic_only_track_sent_packets) { |
| 1672 // In some cases, an MTU probe can cause EMSGSIZE. This indicates that the |
| 1673 // MTU discovery is permanently unsuccessful. |
| 1674 if (FLAGS_graceful_emsgsize_on_mtu_probe && |
| 1675 result.status == WRITE_STATUS_ERROR && |
| 1676 result.error_code == kMessageTooBigErrorCode && |
| 1677 packet->retransmittable_frames.empty() && |
| 1678 packet->encrypted_length > long_term_mtu_) { |
| 1679 mtu_discovery_target_ = 0; |
| 1680 mtu_discovery_alarm_->Cancel(); |
| 1681 // The write failed, but the writer is not blocked, so return true. |
| 1682 return true; |
| 1683 } |
| 1684 |
| 1685 if (result.status == WRITE_STATUS_ERROR) { |
| 1686 OnWriteError(result.error_code); |
| 1687 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted_length |
| 1688 << " from host " |
| 1689 << (self_address().address().empty() |
| 1690 ? " empty address " |
| 1691 : self_address().ToStringWithoutPort()) |
| 1692 << " to address " << peer_address().ToString() |
| 1693 << " with error code " << result.error_code; |
| 1694 return false; |
| 1695 } |
| 1696 } |
| 1697 |
| 1678 if (result.status != WRITE_STATUS_ERROR && debug_visitor_ != nullptr) { | 1698 if (result.status != WRITE_STATUS_ERROR && debug_visitor_ != nullptr) { |
| 1679 // Pass the write result to the visitor. | 1699 // Pass the write result to the visitor. |
| 1680 debug_visitor_->OnPacketSent(*packet, packet->original_path_id, | 1700 debug_visitor_->OnPacketSent(*packet, packet->original_path_id, |
| 1681 packet->original_packet_number, | 1701 packet->original_packet_number, |
| 1682 packet->transmission_type, packet_send_time); | 1702 packet->transmission_type, packet_send_time); |
| 1683 } | 1703 } |
| 1684 if (packet->transmission_type == NOT_RETRANSMISSION) { | 1704 if (packet->transmission_type == NOT_RETRANSMISSION) { |
| 1685 time_of_last_sent_new_packet_ = packet_send_time; | 1705 time_of_last_sent_new_packet_ = packet_send_time; |
| 1686 if (!FLAGS_quic_better_last_send_for_timeout) { | 1706 if (!FLAGS_quic_better_last_send_for_timeout) { |
| 1687 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && | 1707 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && |
| (...skipping 10 matching lines...) Expand all Loading... |
| 1698 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && | 1718 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && |
| 1699 last_send_for_timeout_ <= time_of_last_received_packet_) { | 1719 last_send_for_timeout_ <= time_of_last_received_packet_) { |
| 1700 last_send_for_timeout_ = packet_send_time; | 1720 last_send_for_timeout_ = packet_send_time; |
| 1701 } | 1721 } |
| 1702 } | 1722 } |
| 1703 SetPingAlarm(); | 1723 SetPingAlarm(); |
| 1704 MaybeSetMtuAlarm(); | 1724 MaybeSetMtuAlarm(); |
| 1705 DVLOG(1) << ENDPOINT << "time we began writing last sent packet: " | 1725 DVLOG(1) << ENDPOINT << "time we began writing last sent packet: " |
| 1706 << packet_send_time.ToDebuggingValue(); | 1726 << packet_send_time.ToDebuggingValue(); |
| 1707 | 1727 |
| 1708 if (!FLAGS_quic_simple_packet_number_length_2) { | |
| 1709 // TODO(ianswett): Change the packet number length and other packet creator | |
| 1710 // options by a more explicit API than setting a struct value directly, | |
| 1711 // perhaps via the NetworkChangeVisitor. | |
| 1712 packet_generator_.UpdateSequenceNumberLength( | |
| 1713 sent_packet_manager_->GetLeastUnacked(packet->path_id), | |
| 1714 sent_packet_manager_->EstimateMaxPacketsInFlight(max_packet_length())); | |
| 1715 } | |
| 1716 | |
| 1717 bool reset_retransmission_alarm = sent_packet_manager_->OnPacketSent( | 1728 bool reset_retransmission_alarm = sent_packet_manager_->OnPacketSent( |
| 1718 packet, packet->original_path_id, packet->original_packet_number, | 1729 packet, packet->original_path_id, packet->original_packet_number, |
| 1719 packet_send_time, packet->transmission_type, IsRetransmittable(*packet)); | 1730 packet_send_time, packet->transmission_type, IsRetransmittable(*packet)); |
| 1720 | 1731 |
| 1721 if (reset_retransmission_alarm || !retransmission_alarm_->IsSet()) { | 1732 if (reset_retransmission_alarm || !retransmission_alarm_->IsSet()) { |
| 1722 SetRetransmissionAlarm(); | 1733 SetRetransmissionAlarm(); |
| 1723 } | 1734 } |
| 1724 | 1735 |
| 1725 if (FLAGS_quic_simple_packet_number_length_2) { | 1736 // The packet number length must be updated after OnPacketSent, because it |
| 1726 // The packet number length must be updated after OnPacketSent, because it | 1737 // may change the packet number length in packet. |
| 1727 // may change the packet number length in packet. | 1738 packet_generator_.UpdateSequenceNumberLength( |
| 1728 packet_generator_.UpdateSequenceNumberLength( | 1739 sent_packet_manager_->GetLeastUnacked(packet->path_id), |
| 1729 sent_packet_manager_->GetLeastUnacked(packet->path_id), | 1740 sent_packet_manager_->EstimateMaxPacketsInFlight(max_packet_length())); |
| 1730 sent_packet_manager_->EstimateMaxPacketsInFlight(max_packet_length())); | |
| 1731 } | |
| 1732 | 1741 |
| 1733 stats_.bytes_sent += result.bytes_written; | 1742 stats_.bytes_sent += result.bytes_written; |
| 1734 ++stats_.packets_sent; | 1743 ++stats_.packets_sent; |
| 1735 if (packet->transmission_type != NOT_RETRANSMISSION) { | 1744 if (packet->transmission_type != NOT_RETRANSMISSION) { |
| 1736 stats_.bytes_retransmitted += result.bytes_written; | 1745 stats_.bytes_retransmitted += result.bytes_written; |
| 1737 ++stats_.packets_retransmitted; | 1746 ++stats_.packets_retransmitted; |
| 1738 } | 1747 } |
| 1739 | 1748 |
| 1740 // In some cases, an MTU probe can cause ERR_MSG_TOO_BIG. This indicates that | 1749 if (!FLAGS_quic_only_track_sent_packets) { |
| 1741 // the MTU discovery is permanently unsuccessful. | 1750 // In some cases, an MTU probe can cause EMSGSIZE. This indicates that the |
| 1742 if (FLAGS_graceful_emsgsize_on_mtu_probe && | 1751 // MTU discovery is permanently unsuccessful. |
| 1743 result.status == WRITE_STATUS_ERROR && | 1752 if (FLAGS_graceful_emsgsize_on_mtu_probe && |
| 1744 result.error_code == kMessageTooBigErrorCode && | 1753 result.status == WRITE_STATUS_ERROR && |
| 1745 packet->retransmittable_frames.empty() && | 1754 result.error_code == kMessageTooBigErrorCode && |
| 1746 packet->encrypted_length > long_term_mtu_) { | 1755 packet->retransmittable_frames.empty() && |
| 1747 mtu_discovery_target_ = 0; | 1756 packet->encrypted_length > long_term_mtu_) { |
| 1748 mtu_discovery_alarm_->Cancel(); | 1757 mtu_discovery_target_ = 0; |
| 1749 return true; | 1758 mtu_discovery_alarm_->Cancel(); |
| 1750 } | 1759 return true; |
| 1760 } |
| 1751 | 1761 |
| 1752 if (result.status == WRITE_STATUS_ERROR) { | 1762 if (result.status == WRITE_STATUS_ERROR) { |
| 1753 OnWriteError(result.error_code); | 1763 OnWriteError(result.error_code); |
| 1754 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted_length | 1764 DLOG(ERROR) << ENDPOINT << "failed writing " << encrypted_length |
| 1755 << " bytes " | 1765 << " from host " |
| 1756 << " from host " << (self_address().address().empty() | 1766 << (self_address().address().empty() |
| 1757 ? " empty address " | 1767 ? " empty address " |
| 1758 : self_address().ToStringWithoutPort()) | 1768 : self_address().ToStringWithoutPort()) |
| 1759 << " to address " << peer_address().ToString() | 1769 << " to address " << peer_address().ToString() |
| 1760 << " with error code " << result.error_code; | 1770 << " with error code " << result.error_code; |
| 1761 return false; | 1771 return false; |
| 1772 } |
| 1762 } | 1773 } |
| 1763 | 1774 |
| 1764 return true; | 1775 return true; |
| 1765 } | 1776 } |
| 1766 | 1777 |
| 1767 bool QuicConnection::ShouldDiscardPacket(const SerializedPacket& packet) { | 1778 bool QuicConnection::ShouldDiscardPacket(const SerializedPacket& packet) { |
| 1768 if (!connected_) { | 1779 if (!connected_) { |
| 1769 DVLOG(1) << ENDPOINT << "Not sending packet as connection is disconnected."; | 1780 DVLOG(1) << ENDPOINT << "Not sending packet as connection is disconnected."; |
| 1770 return true; | 1781 return true; |
| 1771 } | 1782 } |
| 1772 | 1783 |
| 1773 QuicPacketNumber packet_number = packet.packet_number; | 1784 QuicPacketNumber packet_number = packet.packet_number; |
| 1774 if (encryption_level_ == ENCRYPTION_FORWARD_SECURE && | 1785 if (encryption_level_ == ENCRYPTION_FORWARD_SECURE && |
| 1775 packet.encryption_level == ENCRYPTION_NONE) { | 1786 packet.encryption_level == ENCRYPTION_NONE) { |
| 1776 // Drop packets that are NULL encrypted since the peer won't accept them | 1787 // Drop packets that are NULL encrypted since the peer won't accept them |
| 1777 // anymore. | 1788 // anymore. |
| 1778 DVLOG(1) << ENDPOINT << "Dropping NULL encrypted packet: " << packet_number | 1789 DVLOG(1) << ENDPOINT << "Dropping NULL encrypted packet: " << packet_number |
| 1779 << " since the connection is forward secure."; | 1790 << " since the connection is forward secure."; |
| 1780 return true; | 1791 return true; |
| 1781 } | 1792 } |
| 1782 | 1793 |
| 1783 return false; | 1794 return false; |
| 1784 } | 1795 } |
| 1785 | 1796 |
| 1786 void QuicConnection::OnWriteError(int error_code) { | 1797 void QuicConnection::OnWriteError(int error_code) { |
| 1787 if (FLAGS_quic_close_connection_on_packet_too_large && write_error_occured_) { | 1798 if (write_error_occured_) { |
| 1788 // A write error already occurred. The connection is being closed. | 1799 // A write error already occurred. The connection is being closed. |
| 1789 return; | 1800 return; |
| 1790 } | 1801 } |
| 1791 write_error_occured_ = true; | 1802 write_error_occured_ = true; |
| 1792 | 1803 |
| 1793 const string error_details = "Write failed with error: " + | 1804 const string error_details = "Write failed with error: " + |
| 1794 base::IntToString(error_code) + " (" + | 1805 base::IntToString(error_code) + " (" + |
| 1795 ErrorToString(error_code) + ")"; | 1806 ErrorToString(error_code) + ")"; |
| 1796 DVLOG(1) << ENDPOINT << error_details; | 1807 DVLOG(1) << ENDPOINT << error_details; |
| 1797 // We can't send an error as the socket is presumably borked. | 1808 // We can't send an error as the socket is presumably borked. |
| 1798 switch (error_code) { | 1809 switch (error_code) { |
| 1799 case kMessageTooBigErrorCode: | 1810 case kMessageTooBigErrorCode: |
| 1800 if (FLAGS_quic_close_connection_on_packet_too_large) { // NOLINT | 1811 CloseConnection( |
| 1801 CloseConnection( | 1812 QUIC_PACKET_WRITE_ERROR, error_details, |
| 1802 QUIC_PACKET_WRITE_ERROR, error_details, | 1813 ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET_WITH_NO_ACK); |
| 1803 FLAGS_quic_do_not_send_ack_on_emsgsize | 1814 break; |
| 1804 ? ConnectionCloseBehavior:: | |
| 1805 SEND_CONNECTION_CLOSE_PACKET_WITH_NO_ACK | |
| 1806 : ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET); | |
| 1807 break; | |
| 1808 } | |
| 1809 default: | 1815 default: |
| 1810 // We can't send an error as the socket is presumably borked. | 1816 // We can't send an error as the socket is presumably borked. |
| 1811 TearDownLocalConnectionState(QUIC_PACKET_WRITE_ERROR, error_details, | 1817 TearDownLocalConnectionState(QUIC_PACKET_WRITE_ERROR, error_details, |
| 1812 ConnectionCloseSource::FROM_SELF); | 1818 ConnectionCloseSource::FROM_SELF); |
| 1813 } | 1819 } |
| 1814 } | 1820 } |
| 1815 | 1821 |
| 1816 void QuicConnection::OnSerializedPacket(SerializedPacket* serialized_packet) { | 1822 void QuicConnection::OnSerializedPacket(SerializedPacket* serialized_packet) { |
| 1817 DCHECK_NE(kInvalidPathId, serialized_packet->path_id); | 1823 DCHECK_NE(kInvalidPathId, serialized_packet->path_id); |
| 1818 if (serialized_packet->encrypted_buffer == nullptr) { | 1824 if (serialized_packet->encrypted_buffer == nullptr) { |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2553 | 2559 |
| 2554 void QuicConnection::CheckIfApplicationLimited() { | 2560 void QuicConnection::CheckIfApplicationLimited() { |
| 2555 if (queued_packets_.empty() && | 2561 if (queued_packets_.empty() && |
| 2556 !sent_packet_manager_->HasPendingRetransmissions() && | 2562 !sent_packet_manager_->HasPendingRetransmissions() && |
| 2557 !visitor_->WillingAndAbleToWrite()) { | 2563 !visitor_->WillingAndAbleToWrite()) { |
| 2558 sent_packet_manager_->OnApplicationLimited(); | 2564 sent_packet_manager_->OnApplicationLimited(); |
| 2559 } | 2565 } |
| 2560 } | 2566 } |
| 2561 | 2567 |
| 2562 } // namespace net | 2568 } // namespace net |
| OLD | NEW |