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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 num_writes += 1; | 177 num_writes += 1; |
178 } | 178 } |
179 if (write_blocked_streams_.headers_stream_blocked()) { | 179 if (write_blocked_streams_.headers_stream_blocked()) { |
180 num_writes += 1; | 180 num_writes += 1; |
181 } | 181 } |
182 } | 182 } |
183 if (num_writes == 0) { | 183 if (num_writes == 0) { |
184 return; | 184 return; |
185 } | 185 } |
186 | 186 |
187 QuicConnection::ScopedPacketBundler ack_bundler(connection_.get(), | 187 QuicConnection::ScopedPacketBundler ack_bundler( |
188 QuicConnection::NO_ACK); | 188 connection_.get(), QuicConnection::SEND_ACK_IF_QUEUED); |
189 for (size_t i = 0; i < num_writes; ++i) { | 189 for (size_t i = 0; i < num_writes; ++i) { |
190 if (!(write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || | 190 if (!(write_blocked_streams_.HasWriteBlockedCryptoOrHeadersStream() || |
191 write_blocked_streams_.HasWriteBlockedDataStreams())) { | 191 write_blocked_streams_.HasWriteBlockedDataStreams())) { |
192 // Writing one stream removed another!? Something's broken. | 192 // Writing one stream removed another!? Something's broken. |
193 QUIC_BUG << "WriteBlockedStream is missing"; | 193 QUIC_BUG << "WriteBlockedStream is missing"; |
194 connection_->CloseConnection(QUIC_INTERNAL_ERROR, | 194 connection_->CloseConnection(QUIC_INTERNAL_ERROR, |
195 ConnectionCloseSource::FROM_SELF); | 195 ConnectionCloseSource::FROM_SELF); |
196 return; | 196 return; |
197 } | 197 } |
198 if (!connection_->CanWriteStreamData()) { | 198 if (!connection_->CanWriteStreamData()) { |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 801 |
802 size_t QuicSession::MaxAvailableStreams() const { | 802 size_t QuicSession::MaxAvailableStreams() const { |
803 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; | 803 return max_open_incoming_streams_ * kMaxAvailableStreamsMultiplier; |
804 } | 804 } |
805 | 805 |
806 bool QuicSession::IsIncomingStream(QuicStreamId id) const { | 806 bool QuicSession::IsIncomingStream(QuicStreamId id) const { |
807 return id % 2 != next_outgoing_stream_id_ % 2; | 807 return id % 2 != next_outgoing_stream_id_ % 2; |
808 } | 808 } |
809 | 809 |
810 } // namespace net | 810 } // namespace net |
OLD | NEW |