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/tools/quic/quic_server_session.h" | 5 #include "net/tools/quic/quic_server_session.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "net/quic/crypto/cached_network_parameters.h" | 8 #include "net/quic/crypto/cached_network_parameters.h" |
9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
10 #include "net/quic/quic_flags.h" | 10 #include "net/quic/quic_flags.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 bandwidth_recorder.EstimateRecordedDuringSlowStart() | 149 bandwidth_recorder.EstimateRecordedDuringSlowStart() |
150 ? CachedNetworkParameters::SLOW_START | 150 ? CachedNetworkParameters::SLOW_START |
151 : CachedNetworkParameters::CONGESTION_AVOIDANCE); | 151 : CachedNetworkParameters::CONGESTION_AVOIDANCE); |
152 cached_network_params.set_timestamp( | 152 cached_network_params.set_timestamp( |
153 connection()->clock()->WallNow().ToUNIXSeconds()); | 153 connection()->clock()->WallNow().ToUNIXSeconds()); |
154 if (!serving_region_.empty()) { | 154 if (!serving_region_.empty()) { |
155 cached_network_params.set_serving_region(serving_region_); | 155 cached_network_params.set_serving_region(serving_region_); |
156 } | 156 } |
157 | 157 |
158 crypto_stream_->SendServerConfigUpdate(&cached_network_params); | 158 crypto_stream_->SendServerConfigUpdate(&cached_network_params); |
| 159 |
| 160 connection()->OnSendConnectionState(cached_network_params); |
| 161 |
159 last_scup_time_ = now; | 162 last_scup_time_ = now; |
160 last_scup_sequence_number_ = | 163 last_scup_sequence_number_ = |
161 connection()->sequence_number_of_last_sent_packet(); | 164 connection()->sequence_number_of_last_sent_packet(); |
162 } | 165 } |
163 | 166 |
164 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) { | 167 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) { |
165 if (id % 2 == 0) { | 168 if (id % 2 == 0) { |
166 DVLOG(1) << "Invalid incoming even stream_id:" << id; | 169 DVLOG(1) << "Invalid incoming even stream_id:" << id; |
167 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); | 170 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); |
168 return false; | 171 return false; |
(...skipping 21 matching lines...) Expand all Loading... |
190 DLOG(ERROR) << "Server push not yet supported"; | 193 DLOG(ERROR) << "Server push not yet supported"; |
191 return nullptr; | 194 return nullptr; |
192 } | 195 } |
193 | 196 |
194 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { | 197 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { |
195 return crypto_stream_.get(); | 198 return crypto_stream_.get(); |
196 } | 199 } |
197 | 200 |
198 } // namespace tools | 201 } // namespace tools |
199 } // namespace net | 202 } // namespace net |
OLD | NEW |