diff options
author | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-19 21:53:34 +0000 |
---|---|---|
committer | rtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-19 21:53:34 +0000 |
commit | 5629971f24e44969dece24cf52a63ef089e22046 (patch) | |
tree | 6ecda9dba33999be6994e4202e72bd3ed5fc111a /net | |
parent | 7f132abf4837de794b46b4d2f1284f44bb24de39 (diff) | |
download | chromium_src-5629971f24e44969dece24cf52a63ef089e22046.zip chromium_src-5629971f24e44969dece24cf52a63ef089e22046.tar.gz chromium_src-5629971f24e44969dece24cf52a63ef089e22046.tar.bz2 |
QUIC - bug fixes for https over quic to work.
- Fix for RetransmitUnackedPackets going in an infinite loop.
- Fix for AddFrame failing after packet_creator_->HasRoomForStreamFrame
success.
- Enable quic_https only if quic_http is enabled (implemented rch's comments).
TODO: Add a flag that sets No QUIC, QUIC+HTTP, QUIC+HTTP+HTTPS
BUG=261475, 261465
TBR=jar@chromium.org, rch@chromium.org, thakis@chromium.org
Review URL: https://codereview.chromium.org/19547010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@212659 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/quic/quic_connection.cc | 24 | ||||
-rw-r--r-- | net/quic/quic_packet_creator.cc | 4 |
2 files changed, 15 insertions, 13 deletions
diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc index 19f2dcd..f407606 100644 --- a/net/quic/quic_connection.cc +++ b/net/quic/quic_connection.cc @@ -474,6 +474,7 @@ void QuicConnection::HandleAckForSentPackets(const QuicAckFrame& incoming_ack, while (it != unacked_packets_.end()) { QuicPacketSequenceNumber sequence_number = it->first; if (sequence_number > peer_largest_observed_packet_) { + // These are very new sequence_numbers. break; } RetransmittableFrames* unacked = it->second; @@ -502,8 +503,7 @@ void QuicConnection::HandleAckForSentPackets(const QuicAckFrame& incoming_ack, DVLOG(1) << ENDPOINT << "Trying to retransmit packet " << sequence_number << " as it has been nacked 3 or more times."; - // TODO(satyamshekhar): save in a vector and retransmit after the - // loop. + // RetransmitPacket will retransmit with a new sequence_number. RetransmitPacket(sequence_number); } } @@ -903,22 +903,25 @@ bool QuicConnection::MaybeRetransmitPacketForRTO( void QuicConnection::RetransmitUnackedPackets( RetransmissionType retransmission_type) { - UnackedPacketMap::iterator current_it = unacked_packets_.begin(); - UnackedPacketMap::iterator next_it; - while (current_it != unacked_packets_.end()) { - next_it = current_it; + if (unacked_packets_.empty()) { + return; + } + UnackedPacketMap::iterator next_it = unacked_packets_.begin(); + QuicPacketSequenceNumber end_sequence_number = + unacked_packets_.rbegin()->first; + do { + UnackedPacketMap::iterator current_it = next_it; ++next_it; - if (retransmission_type != INITIAL_ENCRYPTION_ONLY || + if (retransmission_type == ALL_PACKETS || current_it->second->encryption_level() == ENCRYPTION_INITIAL) { // TODO(satyamshekhar): Think about congestion control here. // Specifically, about the retransmission count of packets being sent // proactively to achieve 0 (minimal) RTT. RetransmitPacket(current_it->first); } - - current_it = next_it; - } + } while (next_it != unacked_packets_.end() && + next_it->first <= end_sequence_number); } void QuicConnection::RetransmitPacket( @@ -938,7 +941,6 @@ void QuicConnection::RetransmitPacket( // congestion window see b/8331807 for details. congestion_manager_.AbandoningPacket(sequence_number); - // TODO(ianswett): Never change the sequence number of the connect packet. // Re-packetize the frames with a new sequence number for retransmission. // Retransmitted data packets do not use FEC, even when it's enabled. SerializedPacket serialized_packet = diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc index 139ed41..51071f9 100644 --- a/net/quic/quic_packet_creator.cc +++ b/net/quic/quic_packet_creator.cc @@ -113,8 +113,8 @@ size_t QuicPacketCreator::CreateStreamFrame(QuicStreamId id, // Comparing against the last stream frame size including the length // guarantees that all the bytes will fit. Otherwise there is a // discontinuity where the packet goes one byte over due to the length data. - if (data.size() > free_bytes - min_last_stream_frame_size - - kQuicStreamPayloadLengthSize) { + if (data.size() + min_last_stream_frame_size + kQuicStreamPayloadLengthSize + >= free_bytes) { // Its the last frame, put as much data as possible in. bytes_consumed = min<size_t>(free_bytes - min_last_stream_frame_size, data.size()); |