| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_server_session.h" | 5 #include "net/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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 bandwidth_recorder.EstimateRecordedDuringSlowStart() | 148 bandwidth_recorder.EstimateRecordedDuringSlowStart() |
| 149 ? CachedNetworkParameters::SLOW_START | 149 ? CachedNetworkParameters::SLOW_START |
| 150 : CachedNetworkParameters::CONGESTION_AVOIDANCE); | 150 : CachedNetworkParameters::CONGESTION_AVOIDANCE); |
| 151 cached_network_params.set_timestamp( | 151 cached_network_params.set_timestamp( |
| 152 connection()->clock()->WallNow().ToUNIXSeconds()); | 152 connection()->clock()->WallNow().ToUNIXSeconds()); |
| 153 if (!serving_region_.empty()) { | 153 if (!serving_region_.empty()) { |
| 154 cached_network_params.set_serving_region(serving_region_); | 154 cached_network_params.set_serving_region(serving_region_); |
| 155 } | 155 } |
| 156 | 156 |
| 157 crypto_stream_->SendServerConfigUpdate(&cached_network_params); | 157 crypto_stream_->SendServerConfigUpdate(&cached_network_params); |
| 158 |
| 159 connection()->OnSendConnectionState(cached_network_params); |
| 160 |
| 158 last_scup_time_ = now; | 161 last_scup_time_ = now; |
| 159 last_scup_sequence_number_ = | 162 last_scup_sequence_number_ = |
| 160 connection()->sequence_number_of_last_sent_packet(); | 163 connection()->sequence_number_of_last_sent_packet(); |
| 161 } | 164 } |
| 162 | 165 |
| 163 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) { | 166 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) { |
| 164 if (id % 2 == 0) { | 167 if (id % 2 == 0) { |
| 165 DVLOG(1) << "Invalid incoming even stream_id:" << id; | 168 DVLOG(1) << "Invalid incoming even stream_id:" << id; |
| 166 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); | 169 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); |
| 167 return false; | 170 return false; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 188 QuicDataStream* QuicServerSession::CreateOutgoingDataStream() { | 191 QuicDataStream* QuicServerSession::CreateOutgoingDataStream() { |
| 189 DLOG(ERROR) << "Server push not yet supported"; | 192 DLOG(ERROR) << "Server push not yet supported"; |
| 190 return nullptr; | 193 return nullptr; |
| 191 } | 194 } |
| 192 | 195 |
| 193 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { | 196 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { |
| 194 return crypto_stream_.get(); | 197 return crypto_stream_.get(); |
| 195 } | 198 } |
| 196 | 199 |
| 197 } // namespace net | 200 } // namespace net |
| OLD | NEW |