| 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_packet_generator.h" | 5 #include "net/quic/quic_packet_generator.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/quic/quic_bug_tracker.h" | 8 #include "net/quic/quic_bug_tracker.h" |
| 9 #include "net/quic/quic_flags.h" | 9 #include "net/quic/quic_flags.h" |
| 10 #include "net/quic/quic_utils.h" | 10 #include "net/quic/quic_utils.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 queued_control_frames_.push_back(frame); | 52 queued_control_frames_.push_back(frame); |
| 53 SendQueuedFrames(/*flush=*/false); | 53 SendQueuedFrames(/*flush=*/false); |
| 54 } | 54 } |
| 55 | 55 |
| 56 QuicConsumedData QuicPacketGenerator::ConsumeData( | 56 QuicConsumedData QuicPacketGenerator::ConsumeData( |
| 57 QuicStreamId id, | 57 QuicStreamId id, |
| 58 QuicIOVector iov, | 58 QuicIOVector iov, |
| 59 QuicStreamOffset offset, | 59 QuicStreamOffset offset, |
| 60 bool fin, | 60 bool fin, |
| 61 QuicAckListenerInterface* listener) { | 61 QuicAckListenerInterface* listener) { |
| 62 bool has_handshake = id == kCryptoStreamId; | 62 bool has_handshake = (id == kCryptoStreamId); |
| 63 QUIC_BUG_IF(has_handshake && fin) |
| 64 << "Handshake packets should never send a fin"; |
| 63 // To make reasoning about crypto frames easier, we don't combine them with | 65 // To make reasoning about crypto frames easier, we don't combine them with |
| 64 // other retransmittable frames in a single packet. | 66 // other retransmittable frames in a single packet. |
| 65 const bool flush = | 67 const bool flush = |
| 66 has_handshake && packet_creator_.HasPendingRetransmittableFrames(); | 68 has_handshake && packet_creator_.HasPendingRetransmittableFrames(); |
| 67 SendQueuedFrames(flush); | 69 SendQueuedFrames(flush); |
| 68 | 70 |
| 69 size_t total_bytes_consumed = 0; | 71 size_t total_bytes_consumed = 0; |
| 70 bool fin_consumed = false; | 72 bool fin_consumed = false; |
| 71 | 73 |
| 72 if (!packet_creator_.HasRoomForStreamFrame(id, offset)) { | 74 if (!packet_creator_.HasRoomForStreamFrame(id, offset)) { |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 296 |
| 295 void QuicPacketGenerator::SetCurrentPath( | 297 void QuicPacketGenerator::SetCurrentPath( |
| 296 QuicPathId path_id, | 298 QuicPathId path_id, |
| 297 QuicPacketNumber least_packet_awaited_by_peer, | 299 QuicPacketNumber least_packet_awaited_by_peer, |
| 298 QuicPacketCount max_packets_in_flight) { | 300 QuicPacketCount max_packets_in_flight) { |
| 299 packet_creator_.SetCurrentPath(path_id, least_packet_awaited_by_peer, | 301 packet_creator_.SetCurrentPath(path_id, least_packet_awaited_by_peer, |
| 300 max_packets_in_flight); | 302 max_packets_in_flight); |
| 301 } | 303 } |
| 302 | 304 |
| 303 } // namespace net | 305 } // namespace net |
| OLD | NEW |