| Index: net/quic/quic_connection.cc
|
| diff --git a/net/quic/quic_connection.cc b/net/quic/quic_connection.cc
|
| index fc68aa4c71c047988d3fbafa143b3da08709d58e..79d5131aa5ee8eca2253810e31225aebd3e0ed46 100644
|
| --- a/net/quic/quic_connection.cc
|
| +++ b/net/quic/quic_connection.cc
|
| @@ -1162,6 +1162,12 @@ void QuicConnection::SendRstStream(QuicStreamId id,
|
| packet_generator_.AddControlFrame(QuicFrame(new QuicRstStreamFrame(
|
| id, AdjustErrorForVersion(error, version()), bytes_written)));
|
|
|
| + if (error == QUIC_STREAM_NO_ERROR && version() > QUIC_VERSION_28) {
|
| + // All data for streams which are reset with QUIC_STREAM_NO_ERROR must
|
| + // be received by the peer.
|
| + return;
|
| + }
|
| +
|
| sent_packet_manager_.CancelRetransmissionsForStream(id);
|
| // Remove all queued packets which only contain data for the reset stream.
|
| QueuedPacketList::iterator packet_iterator = queued_packets_.begin();
|
| @@ -1363,6 +1369,7 @@ bool QuicConnection::ProcessValidatedPacket() {
|
| << peer_address_.ToString() << ", migrating connection.";
|
|
|
| visitor_->OnConnectionMigration();
|
| + sent_packet_manager_.OnConnectionMigration(type);
|
| }
|
|
|
| time_of_last_received_packet_ = clock_->Now();
|
| @@ -1467,6 +1474,11 @@ bool QuicConnection::CanWrite(HasRetransmittableData retransmittable) {
|
| return false;
|
| }
|
|
|
| + // If the send alarm is set, wait for it to fire.
|
| + if (FLAGS_respect_send_alarm && send_alarm_->IsSet()) {
|
| + return false;
|
| + }
|
| +
|
| QuicTime now = clock_->Now();
|
| QuicTime::Delta delay = sent_packet_manager_.TimeUntilSend(
|
| now, retransmittable);
|
| @@ -1482,7 +1494,9 @@ bool QuicConnection::CanWrite(HasRetransmittableData retransmittable) {
|
| << "ms";
|
| return false;
|
| }
|
| - send_alarm_->Cancel();
|
| + if (!FLAGS_respect_send_alarm) {
|
| + send_alarm_->Cancel();
|
| + }
|
| return true;
|
| }
|
|
|
| @@ -1578,8 +1592,8 @@ bool QuicConnection::WritePacketInner(QueuedPacket* packet) {
|
| // Pass the write result to the visitor.
|
| debug_visitor_->OnPacketSent(
|
| packet->serialized_packet, packet->original_packet_number,
|
| - packet->encryption_level, packet->transmission_type, *encrypted,
|
| - packet_send_time);
|
| + packet->encryption_level, packet->transmission_type,
|
| + encrypted->length(), packet_send_time);
|
| }
|
| if (packet->transmission_type == NOT_RETRANSMISSION) {
|
| time_of_last_sent_new_packet_ = packet_send_time;
|
| @@ -1979,11 +1993,11 @@ void QuicConnection::CloseConnection(QuicErrorCode error, bool from_peer) {
|
| return;
|
| }
|
| connected_ = false;
|
| + DCHECK(visitor_ != nullptr);
|
| + visitor_->OnConnectionClosed(error, from_peer);
|
| if (debug_visitor_ != nullptr) {
|
| debug_visitor_->OnConnectionClosed(error, from_peer);
|
| }
|
| - DCHECK(visitor_ != nullptr);
|
| - visitor_->OnConnectionClosed(error, from_peer);
|
| // Cancel the alarms so they don't trigger any action now that the
|
| // connection is closed.
|
| ack_alarm_->Cancel();
|
|
|