| 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 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); | 1690 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); |
| 1691 } | 1691 } |
| 1692 | 1692 |
| 1693 void QuicConnection::OnRttChange() { | 1693 void QuicConnection::OnRttChange() { |
| 1694 // Uses the connection's smoothed RTT. If zero, uses initial_rtt. | 1694 // Uses the connection's smoothed RTT. If zero, uses initial_rtt. |
| 1695 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); | 1695 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); |
| 1696 if (rtt.IsZero()) { | 1696 if (rtt.IsZero()) { |
| 1697 rtt = QuicTime::Delta::FromMicroseconds( | 1697 rtt = QuicTime::Delta::FromMicroseconds( |
| 1698 sent_packet_manager_.GetRttStats()->initial_rtt_us()); | 1698 sent_packet_manager_.GetRttStats()->initial_rtt_us()); |
| 1699 } | 1699 } |
| 1700 if (debug_visitor_) |
| 1701 debug_visitor_->OnRttChanged(rtt); |
| 1700 packet_generator_.OnRttChange(rtt); | 1702 packet_generator_.OnRttChange(rtt); |
| 1701 } | 1703 } |
| 1702 | 1704 |
| 1703 void QuicConnection::OnHandshakeComplete() { | 1705 void QuicConnection::OnHandshakeComplete() { |
| 1704 sent_packet_manager_.SetHandshakeConfirmed(); | 1706 sent_packet_manager_.SetHandshakeConfirmed(); |
| 1705 // The client should immediately ack the SHLO to confirm the handshake is | 1707 // The client should immediately ack the SHLO to confirm the handshake is |
| 1706 // complete with the server. | 1708 // complete with the server. |
| 1707 if (perspective_ == Perspective::IS_CLIENT && !ack_queued_) { | 1709 if (perspective_ == Perspective::IS_CLIENT && !ack_queued_) { |
| 1708 ack_alarm_->Cancel(); | 1710 ack_alarm_->Cancel(); |
| 1709 ack_alarm_->Set(clock_->ApproximateNow()); | 1711 ack_alarm_->Set(clock_->ApproximateNow()); |
| (...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2316 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2318 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
| 2317 ++mtu_probe_count_; | 2319 ++mtu_probe_count_; |
| 2318 | 2320 |
| 2319 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2321 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
| 2320 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2322 SendMtuDiscoveryPacket(mtu_discovery_target_); |
| 2321 | 2323 |
| 2322 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2324 DCHECK(!mtu_discovery_alarm_->IsSet()); |
| 2323 } | 2325 } |
| 2324 | 2326 |
| 2325 } // namespace net | 2327 } // namespace net |
| OLD | NEW |