| 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/source_address_token.h" | 8 #include "net/quic/crypto/source_address_token.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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 cached_network_params.set_previous_connection_state( | 127 cached_network_params.set_previous_connection_state( |
| 128 bandwidth_recorder.EstimateRecordedDuringSlowStart() | 128 bandwidth_recorder.EstimateRecordedDuringSlowStart() |
| 129 ? CachedNetworkParameters::SLOW_START | 129 ? CachedNetworkParameters::SLOW_START |
| 130 : CachedNetworkParameters::CONGESTION_AVOIDANCE); | 130 : CachedNetworkParameters::CONGESTION_AVOIDANCE); |
| 131 cached_network_params.set_timestamp( | 131 cached_network_params.set_timestamp( |
| 132 connection()->clock()->WallNow().ToUNIXSeconds()); | 132 connection()->clock()->WallNow().ToUNIXSeconds()); |
| 133 if (!serving_region_.empty()) { | 133 if (!serving_region_.empty()) { |
| 134 cached_network_params.set_serving_region(serving_region_); | 134 cached_network_params.set_serving_region(serving_region_); |
| 135 } | 135 } |
| 136 | 136 |
| 137 crypto_stream_->SendServerConfigUpdate(&cached_network_params); | 137 crypto_stream_->SendServerConfigUpdate(&cached_network_params, false); |
| 138 last_server_config_update_time_ = now; | 138 last_server_config_update_time_ = now; |
| 139 } | 139 } |
| 140 | 140 |
| 141 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) { | 141 bool QuicServerSession::ShouldCreateIncomingDataStream(QuicStreamId id) { |
| 142 if (id % 2 == 0) { | 142 if (id % 2 == 0) { |
| 143 DVLOG(1) << "Invalid incoming even stream_id:" << id; | 143 DVLOG(1) << "Invalid incoming even stream_id:" << id; |
| 144 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); | 144 connection()->SendConnectionClose(QUIC_INVALID_STREAM_ID); |
| 145 return false; | 145 return false; |
| 146 } | 146 } |
| 147 if (GetNumOpenStreams() >= get_max_open_streams()) { | 147 if (GetNumOpenStreams() >= get_max_open_streams()) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 166 QuicDataStream* QuicServerSession::CreateOutgoingDataStream() { | 166 QuicDataStream* QuicServerSession::CreateOutgoingDataStream() { |
| 167 DLOG(ERROR) << "Server push not yet supported"; | 167 DLOG(ERROR) << "Server push not yet supported"; |
| 168 return nullptr; | 168 return nullptr; |
| 169 } | 169 } |
| 170 | 170 |
| 171 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { | 171 QuicCryptoServerStream* QuicServerSession::GetCryptoStream() { |
| 172 return crypto_stream_.get(); | 172 return crypto_stream_.get(); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace net | 175 } // namespace net |
| OLD | NEW |