| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 // DiscoverMtu() handles rescheduling the alarm by itself. | 181 // DiscoverMtu() handles rescheduling the alarm by itself. |
| 182 return QuicTime::Zero(); | 182 return QuicTime::Zero(); |
| 183 } | 183 } |
| 184 | 184 |
| 185 private: | 185 private: |
| 186 QuicConnection* connection_; | 186 QuicConnection* connection_; |
| 187 | 187 |
| 188 DISALLOW_COPY_AND_ASSIGN(MtuDiscoveryAlarm); | 188 DISALLOW_COPY_AND_ASSIGN(MtuDiscoveryAlarm); |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 // This alarm may be scheduled when an FEC protected packet is sent out. | |
| 192 class FecAlarm : public QuicAlarm::Delegate { | |
| 193 public: | |
| 194 explicit FecAlarm(QuicPacketGenerator* packet_generator) | |
| 195 : packet_generator_(packet_generator) {} | |
| 196 | |
| 197 QuicTime OnAlarm() override { | |
| 198 packet_generator_->OnFecTimeout(); | |
| 199 return QuicTime::Zero(); | |
| 200 } | |
| 201 | |
| 202 private: | |
| 203 QuicPacketGenerator* packet_generator_; | |
| 204 | |
| 205 DISALLOW_COPY_AND_ASSIGN(FecAlarm); | |
| 206 }; | |
| 207 | |
| 208 // Listens for acks of MTU discovery packets and raises the maximum packet size | 191 // Listens for acks of MTU discovery packets and raises the maximum packet size |
| 209 // of the connection if the probe succeeds. | 192 // of the connection if the probe succeeds. |
| 210 class MtuDiscoveryAckListener : public QuicAckListenerInterface { | 193 class MtuDiscoveryAckListener : public QuicAckListenerInterface { |
| 211 public: | 194 public: |
| 212 MtuDiscoveryAckListener(QuicConnection* connection, QuicByteCount probe_size) | 195 MtuDiscoveryAckListener(QuicConnection* connection, QuicByteCount probe_size) |
| 213 : connection_(connection), probe_size_(probe_size) {} | 196 : connection_(connection), probe_size_(probe_size) {} |
| 214 | 197 |
| 215 void OnPacketAcked(int /*acked_bytes*/, | 198 void OnPacketAcked(int /*acked_bytes*/, |
| 216 QuicTime::Delta /*ack delay time*/) override { | 199 QuicTime::Delta /*ack delay time*/) override { |
| 217 // MTU discovery packets are not retransmittable, so it must be acked. | 200 // MTU discovery packets are not retransmittable, so it must be acked. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 ping_alarm_(helper->CreateAlarm(arena_.New<PingAlarm>(this), &arena_)), | 280 ping_alarm_(helper->CreateAlarm(arena_.New<PingAlarm>(this), &arena_)), |
| 298 mtu_discovery_alarm_( | 281 mtu_discovery_alarm_( |
| 299 helper->CreateAlarm(arena_.New<MtuDiscoveryAlarm>(this), &arena_)), | 282 helper->CreateAlarm(arena_.New<MtuDiscoveryAlarm>(this), &arena_)), |
| 300 visitor_(nullptr), | 283 visitor_(nullptr), |
| 301 debug_visitor_(nullptr), | 284 debug_visitor_(nullptr), |
| 302 packet_generator_(connection_id_, | 285 packet_generator_(connection_id_, |
| 303 &framer_, | 286 &framer_, |
| 304 random_generator_, | 287 random_generator_, |
| 305 helper->GetBufferAllocator(), | 288 helper->GetBufferAllocator(), |
| 306 this), | 289 this), |
| 307 fec_alarm_(helper->CreateAlarm(arena_.New<FecAlarm>(&packet_generator_), | |
| 308 &arena_)), | |
| 309 idle_network_timeout_(QuicTime::Delta::Infinite()), | 290 idle_network_timeout_(QuicTime::Delta::Infinite()), |
| 310 handshake_timeout_(QuicTime::Delta::Infinite()), | 291 handshake_timeout_(QuicTime::Delta::Infinite()), |
| 311 time_of_last_received_packet_(clock_->ApproximateNow()), | 292 time_of_last_received_packet_(clock_->ApproximateNow()), |
| 312 time_of_last_sent_new_packet_(clock_->ApproximateNow()), | 293 time_of_last_sent_new_packet_(clock_->ApproximateNow()), |
| 313 last_send_for_timeout_(clock_->ApproximateNow()), | 294 last_send_for_timeout_(clock_->ApproximateNow()), |
| 314 packet_number_of_last_sent_packet_(0), | 295 packet_number_of_last_sent_packet_(0), |
| 315 sent_packet_manager_( | 296 sent_packet_manager_( |
| 316 perspective, | 297 perspective, |
| 317 kDefaultPathId, | 298 kDefaultPathId, |
| 318 clock_, | 299 clock_, |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 371 } |
| 391 | 372 |
| 392 sent_packet_manager_.SetFromConfig(config); | 373 sent_packet_manager_.SetFromConfig(config); |
| 393 if (config.HasReceivedBytesForConnectionId() && | 374 if (config.HasReceivedBytesForConnectionId() && |
| 394 can_truncate_connection_ids_) { | 375 can_truncate_connection_ids_) { |
| 395 packet_generator_.SetConnectionIdLength( | 376 packet_generator_.SetConnectionIdLength( |
| 396 config.ReceivedBytesForConnectionId()); | 377 config.ReceivedBytesForConnectionId()); |
| 397 } | 378 } |
| 398 max_undecryptable_packets_ = config.max_undecryptable_packets(); | 379 max_undecryptable_packets_ = config.max_undecryptable_packets(); |
| 399 | 380 |
| 400 if (config.HasClientSentConnectionOption(kFSPA, perspective_)) { | |
| 401 packet_generator_.set_fec_send_policy(FecSendPolicy::FEC_ALARM_TRIGGER); | |
| 402 } | |
| 403 if (config.HasClientSentConnectionOption(kFRTT, perspective_)) { | |
| 404 // TODO(rtenneti): Delete this code after the 0.25 RTT FEC experiment. | |
| 405 const float kFecTimeoutRttMultiplier = 0.25; | |
| 406 packet_generator_.set_rtt_multiplier_for_fec_timeout( | |
| 407 kFecTimeoutRttMultiplier); | |
| 408 } | |
| 409 | |
| 410 if (config.HasClientSentConnectionOption(kMTUH, perspective_)) { | 381 if (config.HasClientSentConnectionOption(kMTUH, perspective_)) { |
| 411 SetMtuDiscoveryTarget(kMtuDiscoveryTargetPacketSizeHigh); | 382 SetMtuDiscoveryTarget(kMtuDiscoveryTargetPacketSizeHigh); |
| 412 } | 383 } |
| 413 if (config.HasClientSentConnectionOption(kMTUL, perspective_)) { | 384 if (config.HasClientSentConnectionOption(kMTUL, perspective_)) { |
| 414 SetMtuDiscoveryTarget(kMtuDiscoveryTargetPacketSizeLow); | 385 SetMtuDiscoveryTarget(kMtuDiscoveryTargetPacketSizeLow); |
| 415 } | 386 } |
| 416 if (debug_visitor_ != nullptr) { | 387 if (debug_visitor_ != nullptr) { |
| 417 debug_visitor_->OnSetFromConfig(config); | 388 debug_visitor_->OnSetFromConfig(config); |
| 418 } | 389 } |
| 419 if (config.HasClientSentConnectionOption(kACKD, perspective_)) { | 390 if (config.HasClientSentConnectionOption(kACKD, perspective_)) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 440 |
| 470 void QuicConnection::OnError(QuicFramer* framer) { | 441 void QuicConnection::OnError(QuicFramer* framer) { |
| 471 // Packets that we can not or have not decrypted are dropped. | 442 // Packets that we can not or have not decrypted are dropped. |
| 472 // TODO(rch): add stats to measure this. | 443 // TODO(rch): add stats to measure this. |
| 473 if (!connected_ || last_packet_decrypted_ == false) { | 444 if (!connected_ || last_packet_decrypted_ == false) { |
| 474 return; | 445 return; |
| 475 } | 446 } |
| 476 SendConnectionCloseWithDetails(framer->error(), framer->detailed_error()); | 447 SendConnectionCloseWithDetails(framer->error(), framer->detailed_error()); |
| 477 } | 448 } |
| 478 | 449 |
| 479 void QuicConnection::MaybeSetFecAlarm(QuicPacketNumber packet_number) { | |
| 480 if (fec_alarm_->IsSet()) { | |
| 481 return; | |
| 482 } | |
| 483 QuicTime::Delta timeout = packet_generator_.GetFecTimeout(packet_number); | |
| 484 if (!timeout.IsInfinite()) { | |
| 485 fec_alarm_->Update(clock_->ApproximateNow().Add(timeout), | |
| 486 QuicTime::Delta::FromMilliseconds(1)); | |
| 487 } | |
| 488 } | |
| 489 | |
| 490 void QuicConnection::OnPacket() { | 450 void QuicConnection::OnPacket() { |
| 491 last_packet_decrypted_ = false; | 451 last_packet_decrypted_ = false; |
| 492 last_packet_revived_ = false; | 452 last_packet_revived_ = false; |
| 493 } | 453 } |
| 494 | 454 |
| 495 void QuicConnection::OnPublicResetPacket(const QuicPublicResetPacket& packet) { | 455 void QuicConnection::OnPublicResetPacket(const QuicPublicResetPacket& packet) { |
| 496 // Check that any public reset packet with a different connection ID that was | 456 // Check that any public reset packet with a different connection ID that was |
| 497 // routed to this QuicConnection has been redirected before control reaches | 457 // routed to this QuicConnection has been redirected before control reaches |
| 498 // here. (Check for a bug regression.) | 458 // here. (Check for a bug regression.) |
| 499 DCHECK_EQ(connection_id_, packet.public_header.connection_id); | 459 DCHECK_EQ(connection_id_, packet.public_header.connection_id); |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1175 } | 1135 } |
| 1176 | 1136 |
| 1177 pending_version_negotiation_packet_ = false; | 1137 pending_version_negotiation_packet_ = false; |
| 1178 } | 1138 } |
| 1179 | 1139 |
| 1180 QuicConsumedData QuicConnection::SendStreamData( | 1140 QuicConsumedData QuicConnection::SendStreamData( |
| 1181 QuicStreamId id, | 1141 QuicStreamId id, |
| 1182 QuicIOVector iov, | 1142 QuicIOVector iov, |
| 1183 QuicStreamOffset offset, | 1143 QuicStreamOffset offset, |
| 1184 bool fin, | 1144 bool fin, |
| 1185 FecProtection fec_protection, | |
| 1186 QuicAckListenerInterface* listener) { | 1145 QuicAckListenerInterface* listener) { |
| 1187 if (!fin && iov.total_length == 0) { | 1146 if (!fin && iov.total_length == 0) { |
| 1188 QUIC_BUG << "Attempt to send empty stream frame"; | 1147 QUIC_BUG << "Attempt to send empty stream frame"; |
| 1189 return QuicConsumedData(0, false); | 1148 return QuicConsumedData(0, false); |
| 1190 } | 1149 } |
| 1191 | 1150 |
| 1192 // Opportunistically bundle an ack with every outgoing packet. | 1151 // Opportunistically bundle an ack with every outgoing packet. |
| 1193 // Particularly, we want to bundle with handshake packets since we don't know | 1152 // Particularly, we want to bundle with handshake packets since we don't know |
| 1194 // which decrypter will be used on an ack packet following a handshake | 1153 // which decrypter will be used on an ack packet following a handshake |
| 1195 // packet (a handshake packet from client to server could result in a REJ or a | 1154 // packet (a handshake packet from client to server could result in a REJ or a |
| 1196 // SHLO from the server, leading to two different decrypters at the server.) | 1155 // SHLO from the server, leading to two different decrypters at the server.) |
| 1197 // | 1156 // |
| 1198 // TODO(jri): Note that ConsumeData may cause a response packet to be sent. | 1157 // TODO(jri): Note that ConsumeData may cause a response packet to be sent. |
| 1199 // We may end up sending stale ack information if there are undecryptable | 1158 // We may end up sending stale ack information if there are undecryptable |
| 1200 // packets hanging around and/or there are revivable packets which may get | 1159 // packets hanging around and/or there are revivable packets which may get |
| 1201 // handled after this packet is sent. Change ScopedPacketBundler to do the | 1160 // handled after this packet is sent. Change ScopedPacketBundler to do the |
| 1202 // right thing: check ack_queued_, and then check undecryptable packets and | 1161 // right thing: check ack_queued_, and then check undecryptable packets and |
| 1203 // also if there is possibility of revival. Only bundle an ack if there's no | 1162 // also if there is possibility of revival. Only bundle an ack if there's no |
| 1204 // processing left that may cause received_info_ to change. | 1163 // processing left that may cause received_info_ to change. |
| 1205 ScopedRetransmissionScheduler alarm_delayer(this); | 1164 ScopedRetransmissionScheduler alarm_delayer(this); |
| 1206 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); | 1165 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); |
| 1207 return packet_generator_.ConsumeData(id, iov, offset, fin, fec_protection, | 1166 return packet_generator_.ConsumeData(id, iov, offset, fin, listener); |
| 1208 listener); | |
| 1209 } | 1167 } |
| 1210 | 1168 |
| 1211 void QuicConnection::SendRstStream(QuicStreamId id, | 1169 void QuicConnection::SendRstStream(QuicStreamId id, |
| 1212 QuicRstStreamErrorCode error, | 1170 QuicRstStreamErrorCode error, |
| 1213 QuicStreamOffset bytes_written) { | 1171 QuicStreamOffset bytes_written) { |
| 1214 // Opportunistically bundle an ack with this outgoing packet. | 1172 // Opportunistically bundle an ack with this outgoing packet. |
| 1215 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); | 1173 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); |
| 1216 packet_generator_.AddControlFrame(QuicFrame(new QuicRstStreamFrame( | 1174 packet_generator_.AddControlFrame(QuicFrame(new QuicRstStreamFrame( |
| 1217 id, AdjustErrorForVersion(error, version()), bytes_written))); | 1175 id, AdjustErrorForVersion(error, version()), bytes_written))); |
| 1218 | 1176 |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1512 // Keep writing as long as there's a pending retransmission which can be | 1470 // Keep writing as long as there's a pending retransmission which can be |
| 1513 // written. | 1471 // written. |
| 1514 while (sent_packet_manager_.HasPendingRetransmissions()) { | 1472 while (sent_packet_manager_.HasPendingRetransmissions()) { |
| 1515 const PendingRetransmission pending = | 1473 const PendingRetransmission pending = |
| 1516 sent_packet_manager_.NextPendingRetransmission(); | 1474 sent_packet_manager_.NextPendingRetransmission(); |
| 1517 if (!CanWrite(HAS_RETRANSMITTABLE_DATA)) { | 1475 if (!CanWrite(HAS_RETRANSMITTABLE_DATA)) { |
| 1518 break; | 1476 break; |
| 1519 } | 1477 } |
| 1520 | 1478 |
| 1521 // Re-packetize the frames with a new packet number for retransmission. | 1479 // Re-packetize the frames with a new packet number for retransmission. |
| 1522 // Retransmitted data packets do not use FEC, even when it's enabled. | |
| 1523 // Retransmitted packets use the same packet number length as the | 1480 // Retransmitted packets use the same packet number length as the |
| 1524 // original. | 1481 // original. |
| 1525 // Flush the packet generator before making a new packet. | 1482 // Flush the packet generator before making a new packet. |
| 1526 // TODO(ianswett): Implement ReserializeAllFrames as a separate path that | 1483 // TODO(ianswett): Implement ReserializeAllFrames as a separate path that |
| 1527 // does not require the creator to be flushed. | 1484 // does not require the creator to be flushed. |
| 1528 packet_generator_.FlushAllQueuedFrames(); | 1485 packet_generator_.FlushAllQueuedFrames(); |
| 1529 char buffer[kMaxPacketSize]; | 1486 char buffer[kMaxPacketSize]; |
| 1530 packet_generator_.ReserializeAllFrames(pending, buffer, kMaxPacketSize); | 1487 packet_generator_.ReserializeAllFrames(pending, buffer, kMaxPacketSize); |
| 1531 } | 1488 } |
| 1532 } | 1489 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1683 packet->transmission_type, packet_send_time); | 1640 packet->transmission_type, packet_send_time); |
| 1684 } | 1641 } |
| 1685 if (packet->transmission_type == NOT_RETRANSMISSION) { | 1642 if (packet->transmission_type == NOT_RETRANSMISSION) { |
| 1686 time_of_last_sent_new_packet_ = packet_send_time; | 1643 time_of_last_sent_new_packet_ = packet_send_time; |
| 1687 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && | 1644 if (IsRetransmittable(*packet) == HAS_RETRANSMITTABLE_DATA && |
| 1688 last_send_for_timeout_ <= time_of_last_received_packet_) { | 1645 last_send_for_timeout_ <= time_of_last_received_packet_) { |
| 1689 last_send_for_timeout_ = packet_send_time; | 1646 last_send_for_timeout_ = packet_send_time; |
| 1690 } | 1647 } |
| 1691 } | 1648 } |
| 1692 SetPingAlarm(); | 1649 SetPingAlarm(); |
| 1693 MaybeSetFecAlarm(packet_number); | |
| 1694 MaybeSetMtuAlarm(); | 1650 MaybeSetMtuAlarm(); |
| 1695 DVLOG(1) << ENDPOINT << "time we began writing last sent packet: " | 1651 DVLOG(1) << ENDPOINT << "time we began writing last sent packet: " |
| 1696 << packet_send_time.ToDebuggingValue(); | 1652 << packet_send_time.ToDebuggingValue(); |
| 1697 | 1653 |
| 1698 // TODO(ianswett): Change the packet number length and other packet creator | 1654 // TODO(ianswett): Change the packet number length and other packet creator |
| 1699 // options by a more explicit API than setting a struct value directly, | 1655 // options by a more explicit API than setting a struct value directly, |
| 1700 // perhaps via the NetworkChangeVisitor. | 1656 // perhaps via the NetworkChangeVisitor. |
| 1701 packet_generator_.UpdateSequenceNumberLength( | 1657 packet_generator_.UpdateSequenceNumberLength( |
| 1702 sent_packet_manager_.least_packet_awaited_by_peer(), | 1658 sent_packet_manager_.least_packet_awaited_by_peer(), |
| 1703 sent_packet_manager_.EstimateMaxPacketsInFlight(max_packet_length())); | 1659 sent_packet_manager_.EstimateMaxPacketsInFlight(max_packet_length())); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1771 void QuicConnection::OnSerializedPacket(SerializedPacket* serialized_packet) { | 1727 void QuicConnection::OnSerializedPacket(SerializedPacket* serialized_packet) { |
| 1772 DCHECK_NE(kInvalidPathId, serialized_packet->path_id); | 1728 DCHECK_NE(kInvalidPathId, serialized_packet->path_id); |
| 1773 if (serialized_packet->encrypted_buffer == nullptr) { | 1729 if (serialized_packet->encrypted_buffer == nullptr) { |
| 1774 // We failed to serialize the packet, so close the connection. | 1730 // We failed to serialize the packet, so close the connection. |
| 1775 // CloseConnection does not send close packet, so no infinite loop here. | 1731 // CloseConnection does not send close packet, so no infinite loop here. |
| 1776 // TODO(ianswett): This is actually an internal error, not an encryption | 1732 // TODO(ianswett): This is actually an internal error, not an encryption |
| 1777 // failure. | 1733 // failure. |
| 1778 CloseConnection(QUIC_ENCRYPTION_FAILURE, ConnectionCloseSource::FROM_SELF); | 1734 CloseConnection(QUIC_ENCRYPTION_FAILURE, ConnectionCloseSource::FROM_SELF); |
| 1779 return; | 1735 return; |
| 1780 } | 1736 } |
| 1781 if (serialized_packet->is_fec_packet && fec_alarm_->IsSet()) { | |
| 1782 // If an FEC packet is serialized with the FEC alarm set, cancel the alarm. | |
| 1783 fec_alarm_->Cancel(); | |
| 1784 } | |
| 1785 SendOrQueuePacket(serialized_packet); | 1737 SendOrQueuePacket(serialized_packet); |
| 1786 } | 1738 } |
| 1787 | 1739 |
| 1788 void QuicConnection::OnUnrecoverableError(QuicErrorCode error, | 1740 void QuicConnection::OnUnrecoverableError(QuicErrorCode error, |
| 1789 ConnectionCloseSource source) { | 1741 ConnectionCloseSource source) { |
| 1790 // The packet creator or generator encountered an unrecoverable error: tear | 1742 // The packet creator or generator encountered an unrecoverable error: tear |
| 1791 // down local connection state immediately. | 1743 // down local connection state immediately. |
| 1792 CloseConnection(error, source); | 1744 CloseConnection(error, source); |
| 1793 } | 1745 } |
| 1794 | 1746 |
| 1795 void QuicConnection::OnResetFecGroup() { | |
| 1796 if (!fec_alarm_->IsSet()) { | |
| 1797 return; | |
| 1798 } | |
| 1799 // If an FEC Group is closed with the FEC alarm set, cancel the alarm. | |
| 1800 fec_alarm_->Cancel(); | |
| 1801 } | |
| 1802 | |
| 1803 void QuicConnection::OnCongestionWindowChange() { | 1747 void QuicConnection::OnCongestionWindowChange() { |
| 1804 packet_generator_.OnCongestionWindowChange( | |
| 1805 sent_packet_manager_.EstimateMaxPacketsInFlight(max_packet_length())); | |
| 1806 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); | 1748 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); |
| 1807 } | 1749 } |
| 1808 | 1750 |
| 1809 void QuicConnection::OnRttChange() { | 1751 void QuicConnection::OnRttChange() { |
| 1810 // Uses the connection's smoothed RTT. If zero, uses initial_rtt. | 1752 // Uses the connection's smoothed RTT. If zero, uses initial_rtt. |
| 1811 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); | 1753 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); |
| 1812 if (rtt.IsZero()) { | 1754 if (rtt.IsZero()) { |
| 1813 rtt = QuicTime::Delta::FromMicroseconds( | 1755 rtt = QuicTime::Delta::FromMicroseconds( |
| 1814 sent_packet_manager_.GetRttStats()->initial_rtt_us()); | 1756 sent_packet_manager_.GetRttStats()->initial_rtt_us()); |
| 1815 } | 1757 } |
| 1758 |
| 1816 if (debug_visitor_) | 1759 if (debug_visitor_) |
| 1817 debug_visitor_->OnRttChanged(rtt); | 1760 debug_visitor_->OnRttChanged(rtt); |
| 1818 packet_generator_.OnRttChange(rtt); | |
| 1819 } | 1761 } |
| 1820 | 1762 |
| 1821 void QuicConnection::OnPathDegrading() { | 1763 void QuicConnection::OnPathDegrading() { |
| 1822 visitor_->OnPathDegrading(); | 1764 visitor_->OnPathDegrading(); |
| 1823 } | 1765 } |
| 1824 | 1766 |
| 1825 void QuicConnection::OnHandshakeComplete() { | 1767 void QuicConnection::OnHandshakeComplete() { |
| 1826 sent_packet_manager_.SetHandshakeConfirmed(); | 1768 sent_packet_manager_.SetHandshakeConfirmed(); |
| 1827 // The client should immediately ack the SHLO to confirm the handshake is | 1769 // The client should immediately ack the SHLO to confirm the handshake is |
| 1828 // complete with the server. | 1770 // complete with the server. |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2108 } else { | 2050 } else { |
| 2109 UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true); | 2051 UMA_HISTOGRAM_BOOLEAN("Net.QuicCloseConnection.NullVisitor", true); |
| 2110 } | 2052 } |
| 2111 if (debug_visitor_ != nullptr) { | 2053 if (debug_visitor_ != nullptr) { |
| 2112 debug_visitor_->OnConnectionClosed(error, source); | 2054 debug_visitor_->OnConnectionClosed(error, source); |
| 2113 } | 2055 } |
| 2114 // Cancel the alarms so they don't trigger any action now that the | 2056 // Cancel the alarms so they don't trigger any action now that the |
| 2115 // connection is closed. | 2057 // connection is closed. |
| 2116 ack_alarm_->Cancel(); | 2058 ack_alarm_->Cancel(); |
| 2117 ping_alarm_->Cancel(); | 2059 ping_alarm_->Cancel(); |
| 2118 fec_alarm_->Cancel(); | |
| 2119 resume_writes_alarm_->Cancel(); | 2060 resume_writes_alarm_->Cancel(); |
| 2120 retransmission_alarm_->Cancel(); | 2061 retransmission_alarm_->Cancel(); |
| 2121 send_alarm_->Cancel(); | 2062 send_alarm_->Cancel(); |
| 2122 timeout_alarm_->Cancel(); | 2063 timeout_alarm_->Cancel(); |
| 2123 mtu_discovery_alarm_->Cancel(); | 2064 mtu_discovery_alarm_->Cancel(); |
| 2124 } | 2065 } |
| 2125 | 2066 |
| 2126 void QuicConnection::SendGoAway(QuicErrorCode error, | 2067 void QuicConnection::SendGoAway(QuicErrorCode error, |
| 2127 QuicStreamId last_good_stream_id, | 2068 QuicStreamId last_good_stream_id, |
| 2128 const string& reason) { | 2069 const string& reason) { |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2518 void QuicConnection::OnPathClosed(QuicPathId path_id) { | 2459 void QuicConnection::OnPathClosed(QuicPathId path_id) { |
| 2519 // Stop receiving packets on this path. | 2460 // Stop receiving packets on this path. |
| 2520 framer_.OnPathClosed(path_id); | 2461 framer_.OnPathClosed(path_id); |
| 2521 } | 2462 } |
| 2522 | 2463 |
| 2523 bool QuicConnection::ack_frame_updated() const { | 2464 bool QuicConnection::ack_frame_updated() const { |
| 2524 return received_packet_manager_.ack_frame_updated(); | 2465 return received_packet_manager_.ack_frame_updated(); |
| 2525 } | 2466 } |
| 2526 | 2467 |
| 2527 } // namespace net | 2468 } // namespace net |
| OLD | NEW |