OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s)); | 107 QuicTime::Delta::FromSeconds(FLAGS_quic_recent_min_rtt_window_s)); |
108 } | 108 } |
109 send_algorithm_.reset( | 109 send_algorithm_.reset( |
110 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kBBR, stats_)); | 110 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kBBR, stats_)); |
111 } | 111 } |
112 if (config.HasReceivedConnectionOptions() && | 112 if (config.HasReceivedConnectionOptions() && |
113 ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) { | 113 ContainsQuicTag(config.ReceivedConnectionOptions(), kRENO)) { |
114 send_algorithm_.reset( | 114 send_algorithm_.reset( |
115 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kReno, stats_)); | 115 SendAlgorithmInterface::Create(clock_, &rtt_stats_, kReno, stats_)); |
116 } | 116 } |
117 if (config.HasReceivedConnectionOptions() && | 117 if (is_server_) { |
118 ContainsQuicTag(config.ReceivedConnectionOptions(), kPACE)) { | 118 if (config.HasReceivedConnectionOptions() && |
| 119 ContainsQuicTag(config.ReceivedConnectionOptions(), kPACE)) { |
| 120 EnablePacing(); |
| 121 } |
| 122 } else if (config.HasSendConnectionOptions() && |
| 123 ContainsQuicTag(config.SendConnectionOptions(), kPACE)) { |
119 EnablePacing(); | 124 EnablePacing(); |
120 } | 125 } |
121 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once | 126 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once |
122 // the ConnectionOptions code is live everywhere. | 127 // the ConnectionOptions code is live everywhere. |
123 if ((config.HasReceivedLossDetection() && | 128 if ((config.HasReceivedLossDetection() && |
124 config.ReceivedLossDetection() == kTIME) || | 129 config.ReceivedLossDetection() == kTIME) || |
125 (config.HasReceivedConnectionOptions() && | 130 (config.HasReceivedConnectionOptions() && |
126 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME))) { | 131 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME))) { |
127 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); | 132 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); |
128 } | 133 } |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 | 891 |
887 // Set up a pacing sender with a 5 millisecond alarm granularity. | 892 // Set up a pacing sender with a 5 millisecond alarm granularity. |
888 using_pacing_ = true; | 893 using_pacing_ = true; |
889 send_algorithm_.reset( | 894 send_algorithm_.reset( |
890 new PacingSender(send_algorithm_.release(), | 895 new PacingSender(send_algorithm_.release(), |
891 QuicTime::Delta::FromMilliseconds(5), | 896 QuicTime::Delta::FromMilliseconds(5), |
892 kInitialUnpacedBurst)); | 897 kInitialUnpacedBurst)); |
893 } | 898 } |
894 | 899 |
895 } // namespace net | 900 } // namespace net |
OLD | NEW |