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_session.h" | 5 #include "net/quic/quic_session.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "net/quic/crypto/proof_verifier.h" | 10 #include "net/quic/crypto/proof_verifier.h" |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 const IPEndPoint& peer_address, | 232 const IPEndPoint& peer_address, |
233 const QuicEncryptedPacket& packet) { | 233 const QuicEncryptedPacket& packet) { |
234 connection_->ProcessUdpPacket(self_address, peer_address, packet); | 234 connection_->ProcessUdpPacket(self_address, peer_address, packet); |
235 } | 235 } |
236 | 236 |
237 QuicConsumedData QuicSession::WritevData( | 237 QuicConsumedData QuicSession::WritevData( |
238 QuicStreamId id, | 238 QuicStreamId id, |
239 QuicIOVector iov, | 239 QuicIOVector iov, |
240 QuicStreamOffset offset, | 240 QuicStreamOffset offset, |
241 bool fin, | 241 bool fin, |
242 FecProtection fec_protection, | |
243 QuicAckListenerInterface* ack_notifier_delegate) { | 242 QuicAckListenerInterface* ack_notifier_delegate) { |
244 if (!IsEncryptionEstablished() && id != kCryptoStreamId) { | 243 if (!IsEncryptionEstablished() && id != kCryptoStreamId) { |
245 // Do not let streams write without encryption. The calling stream will end | 244 // Do not let streams write without encryption. The calling stream will end |
246 // up write blocked until OnCanWrite is next called. | 245 // up write blocked until OnCanWrite is next called. |
247 return QuicConsumedData(0, false); | 246 return QuicConsumedData(0, false); |
248 } | 247 } |
249 QuicConsumedData data = connection_->SendStreamData( | 248 QuicConsumedData data = |
250 id, iov, offset, fin, fec_protection, ack_notifier_delegate); | 249 connection_->SendStreamData(id, iov, offset, fin, ack_notifier_delegate); |
251 write_blocked_streams_.UpdateBytesForStream(id, data.bytes_consumed); | 250 write_blocked_streams_.UpdateBytesForStream(id, data.bytes_consumed); |
252 return data; | 251 return data; |
253 } | 252 } |
254 | 253 |
255 void QuicSession::SendRstStream(QuicStreamId id, | 254 void QuicSession::SendRstStream(QuicStreamId id, |
256 QuicRstStreamErrorCode error, | 255 QuicRstStreamErrorCode error, |
257 QuicStreamOffset bytes_written) { | 256 QuicStreamOffset bytes_written) { |
258 if (ContainsKey(static_stream_map_, id)) { | 257 if (ContainsKey(static_stream_map_, id)) { |
259 QUIC_BUG << "Cannot send RST for a static stream with ID " << id; | 258 QUIC_BUG << "Cannot send RST for a static stream with ID " << id; |
260 return; | 259 return; |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 | 801 |
803 size_t QuicSession::MaxAvailableStreams() const { | 802 size_t QuicSession::MaxAvailableStreams() const { |
804 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; | 803 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; |
805 } | 804 } |
806 | 805 |
807 bool QuicSession::IsIncomingStream(QuicStreamId id) const { | 806 bool QuicSession::IsIncomingStream(QuicStreamId id) const { |
808 return id % 2 != next_outgoing_stream_id_ % 2; | 807 return id % 2 != next_outgoing_stream_id_ % 2; |
809 } | 808 } |
810 | 809 |
811 } // namespace net | 810 } // namespace net |
OLD | NEW |