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

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

Issue 1470713003: Landing Recent QUIC changes until and including Mon Nov 16 14:15:48 2015 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding NET_EXPORT_PRIVATE to DelegateInterface. Created 5 years 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
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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 if (last_header_.packet_number <= largest_seen_packet_with_ack_) { 730 if (last_header_.packet_number <= largest_seen_packet_with_ack_) {
731 DVLOG(1) << ENDPOINT << "Received an old ack frame: ignoring"; 731 DVLOG(1) << ENDPOINT << "Received an old ack frame: ignoring";
732 return true; 732 return true;
733 } 733 }
734 734
735 if (!ValidateAckFrame(incoming_ack)) { 735 if (!ValidateAckFrame(incoming_ack)) {
736 SendConnectionClose(QUIC_INVALID_ACK_DATA); 736 SendConnectionClose(QUIC_INVALID_ACK_DATA);
737 return false; 737 return false;
738 } 738 }
739 739
740 if (FLAGS_quic_respect_send_alarm && send_alarm_->IsSet()) {
741 send_alarm_->Cancel();
742 }
740 ProcessAckFrame(incoming_ack); 743 ProcessAckFrame(incoming_ack);
741 if (incoming_ack.is_truncated) { 744 if (incoming_ack.is_truncated) {
742 should_last_packet_instigate_acks_ = true; 745 should_last_packet_instigate_acks_ = true;
743 } 746 }
744 // If the peer is still waiting for a packet that we are no longer planning to 747 // If the peer is still waiting for a packet that we are no longer planning to
745 // send, send an ack to raise the high water mark. 748 // send, send an ack to raise the high water mark.
746 if (!incoming_ack.missing_packets.Empty() && 749 if (!incoming_ack.missing_packets.Empty() &&
747 GetLeastUnacked() > incoming_ack.missing_packets.Min()) { 750 GetLeastUnacked() > incoming_ack.missing_packets.Min()) {
748 ++stop_waiting_count_; 751 ++stop_waiting_count_;
749 } else { 752 } else {
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 if (!connected_) { 1471 if (!connected_) {
1469 return false; 1472 return false;
1470 } 1473 }
1471 1474
1472 if (writer_->IsWriteBlocked()) { 1475 if (writer_->IsWriteBlocked()) {
1473 visitor_->OnWriteBlocked(); 1476 visitor_->OnWriteBlocked();
1474 return false; 1477 return false;
1475 } 1478 }
1476 1479
1477 // If the send alarm is set, wait for it to fire. 1480 // If the send alarm is set, wait for it to fire.
1478 if (FLAGS_respect_send_alarm && send_alarm_->IsSet()) { 1481 if (FLAGS_quic_respect_send_alarm && send_alarm_->IsSet()) {
1479 return false; 1482 return false;
1480 } 1483 }
1481 1484
1482 QuicTime now = clock_->Now(); 1485 QuicTime now = clock_->Now();
1483 QuicTime::Delta delay = sent_packet_manager_.TimeUntilSend( 1486 QuicTime::Delta delay = sent_packet_manager_.TimeUntilSend(
1484 now, retransmittable); 1487 now, retransmittable);
1485 if (delay.IsInfinite()) { 1488 if (delay.IsInfinite()) {
1486 send_alarm_->Cancel(); 1489 send_alarm_->Cancel();
1487 return false; 1490 return false;
1488 } 1491 }
1489 1492
1490 // If the scheduler requires a delay, then we can not send this packet now. 1493 // If the scheduler requires a delay, then we can not send this packet now.
1491 if (!delay.IsZero()) { 1494 if (!delay.IsZero()) {
1492 send_alarm_->Update(now.Add(delay), QuicTime::Delta::FromMilliseconds(1)); 1495 send_alarm_->Update(now.Add(delay), QuicTime::Delta::FromMilliseconds(1));
1493 DVLOG(1) << ENDPOINT << "Delaying sending " << delay.ToMilliseconds() 1496 DVLOG(1) << ENDPOINT << "Delaying sending " << delay.ToMilliseconds()
1494 << "ms"; 1497 << "ms";
1495 return false; 1498 return false;
1496 } 1499 }
1497 if (!FLAGS_respect_send_alarm) { 1500 if (!FLAGS_quic_respect_send_alarm) {
1498 send_alarm_->Cancel(); 1501 send_alarm_->Cancel();
1499 } 1502 }
1500 return true; 1503 return true;
1501 } 1504 }
1502 1505
1503 bool QuicConnection::WritePacket(QueuedPacket* packet) { 1506 bool QuicConnection::WritePacket(QueuedPacket* packet) {
1504 if (!WritePacketInner(packet)) { 1507 if (!WritePacketInner(packet)) {
1505 return false; 1508 return false;
1506 } 1509 }
1507 delete packet->serialized_packet.retransmittable_frames; 1510 delete packet->serialized_packet.retransmittable_frames;
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
2351 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; 2354 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1;
2352 ++mtu_probe_count_; 2355 ++mtu_probe_count_;
2353 2356
2354 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; 2357 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_;
2355 SendMtuDiscoveryPacket(mtu_discovery_target_); 2358 SendMtuDiscoveryPacket(mtu_discovery_target_);
2356 2359
2357 DCHECK(!mtu_discovery_alarm_->IsSet()); 2360 DCHECK(!mtu_discovery_alarm_->IsSet());
2358 } 2361 }
2359 2362
2360 } // namespace net 2363 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698