Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: net/quic/quic_connection.cc

Issue 1413373013: Quic streams honor RST_STREAM + NO_ERROR on the write side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@106851267
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 } 1155 }
1156 1156
1157 void QuicConnection::SendRstStream(QuicStreamId id, 1157 void QuicConnection::SendRstStream(QuicStreamId id,
1158 QuicRstStreamErrorCode error, 1158 QuicRstStreamErrorCode error,
1159 QuicStreamOffset bytes_written) { 1159 QuicStreamOffset bytes_written) {
1160 // Opportunistically bundle an ack with this outgoing packet. 1160 // Opportunistically bundle an ack with this outgoing packet.
1161 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK); 1161 ScopedPacketBundler ack_bundler(this, BUNDLE_PENDING_ACK);
1162 packet_generator_.AddControlFrame(QuicFrame(new QuicRstStreamFrame( 1162 packet_generator_.AddControlFrame(QuicFrame(new QuicRstStreamFrame(
1163 id, AdjustErrorForVersion(error, version()), bytes_written))); 1163 id, AdjustErrorForVersion(error, version()), bytes_written)));
1164 1164
1165 if (error == QUIC_STREAM_NO_ERROR && version() > QUIC_VERSION_28) {
1166 // All data for streams which are reset with QUIC_STREAM_NO_ERROR must
1167 // be received by the peer.
1168 return;
1169 }
1170
1165 sent_packet_manager_.CancelRetransmissionsForStream(id); 1171 sent_packet_manager_.CancelRetransmissionsForStream(id);
1166 // Remove all queued packets which only contain data for the reset stream. 1172 // Remove all queued packets which only contain data for the reset stream.
1167 QueuedPacketList::iterator packet_iterator = queued_packets_.begin(); 1173 QueuedPacketList::iterator packet_iterator = queued_packets_.begin();
1168 while (packet_iterator != queued_packets_.end()) { 1174 while (packet_iterator != queued_packets_.end()) {
1169 RetransmittableFrames* retransmittable_frames = 1175 RetransmittableFrames* retransmittable_frames =
1170 packet_iterator->serialized_packet.retransmittable_frames; 1176 packet_iterator->serialized_packet.retransmittable_frames;
1171 if (!retransmittable_frames) { 1177 if (!retransmittable_frames) {
1172 ++packet_iterator; 1178 ++packet_iterator;
1173 continue; 1179 continue;
1174 } 1180 }
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
2338 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; 2344 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1;
2339 ++mtu_probe_count_; 2345 ++mtu_probe_count_;
2340 2346
2341 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; 2347 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_;
2342 SendMtuDiscoveryPacket(mtu_discovery_target_); 2348 SendMtuDiscoveryPacket(mtu_discovery_target_);
2343 2349
2344 DCHECK(!mtu_discovery_alarm_->IsSet()); 2350 DCHECK(!mtu_discovery_alarm_->IsSet());
2345 } 2351 }
2346 2352
2347 } // namespace net 2353 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698