| 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 1594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1605 QUIC_LOG_FIRST_N(ERROR, 10) | 1605 QUIC_LOG_FIRST_N(ERROR, 10) |
| 1606 << ENDPOINT << "failed writing " << encrypted_length | 1606 << ENDPOINT << "failed writing " << encrypted_length |
| 1607 << " bytes from host " << self_address().host().ToString() | 1607 << " bytes from host " << self_address().host().ToString() |
| 1608 << " to address " << peer_address().ToString() << " with error code " | 1608 << " to address " << peer_address().ToString() << " with error code " |
| 1609 << result.error_code; | 1609 << result.error_code; |
| 1610 return false; | 1610 return false; |
| 1611 } | 1611 } |
| 1612 | 1612 |
| 1613 if (result.status != WRITE_STATUS_ERROR && debug_visitor_ != nullptr) { | 1613 if (result.status != WRITE_STATUS_ERROR && debug_visitor_ != nullptr) { |
| 1614 // Pass the write result to the visitor. | 1614 // Pass the write result to the visitor. |
| 1615 debug_visitor_->OnPacketSent(*packet, packet->original_path_id, | 1615 debug_visitor_->OnPacketSent(*packet, packet->original_packet_number, |
| 1616 packet->original_packet_number, | |
| 1617 packet->transmission_type, packet_send_time); | 1616 packet->transmission_type, packet_send_time); |
| 1618 } | 1617 } |
| 1619 if (packet->transmission_type == NOT_RETRANSMISSION) { | 1618 if (packet->transmission_type == NOT_RETRANSMISSION) { |
| 1620 time_of_last_sent_new_packet_ = packet_send_time; | 1619 time_of_last_sent_new_packet_ = packet_send_time; |
| 1621 } | 1620 } |
| 1622 // Only adjust the last sent time (for the purpose of tracking the idle | 1621 // Only adjust the last sent time (for the purpose of tracking the idle |
| 1623 // timeout) if this is the first retransmittable packet sent after a | 1622 // timeout) if this is the first retransmittable packet sent after a |
| 1624 // packet is received. If it were updated on every sent packet, then | 1623 // packet is received. If it were updated on every sent packet, then |
| 1625 // sending into a black hole might never timeout. | 1624 // sending into a black hole might never timeout. |
| 1626 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && | 1625 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2447 | 2446 |
| 2448 void QuicConnection::CheckIfApplicationLimited() { | 2447 void QuicConnection::CheckIfApplicationLimited() { |
| 2449 if (queued_packets_.empty() && | 2448 if (queued_packets_.empty() && |
| 2450 !sent_packet_manager_.HasPendingRetransmissions() && | 2449 !sent_packet_manager_.HasPendingRetransmissions() && |
| 2451 !visitor_->WillingAndAbleToWrite()) { | 2450 !visitor_->WillingAndAbleToWrite()) { |
| 2452 sent_packet_manager_.OnApplicationLimited(); | 2451 sent_packet_manager_.OnApplicationLimited(); |
| 2453 } | 2452 } |
| 2454 } | 2453 } |
| 2455 | 2454 |
| 2456 } // namespace net | 2455 } // namespace net |
| OLD | NEW |