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_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 Loading... |
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 Loading... |
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 |
OLD | NEW |