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

Unified Diff: net/quic/quic_packet_generator.cc

Issue 1421853006: Landing Recent QUIC changes until: Fri Oct 30 22:23:58 2015 +0000 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_packet_generator.cc
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc
index a5e707e57505dc8e22ef930d1f89d141e3d5313b..12ebcfb0e5a750a01027638bc0bade9faa167749 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -288,28 +288,28 @@ void QuicPacketGenerator::MaybeStartFecProtection() {
void QuicPacketGenerator::MaybeSendFecPacketAndCloseGroup(bool force,
bool is_fec_timeout) {
- if (!ShouldSendFecPacket(force)) {
- return;
+ if (ShouldSendFecPacket(force)) {
+ // If we want to send FEC packet only when FEC alaram goes off and if it is
+ // not a FEC timeout then close the group and dont send FEC packet.
+ if (fec_send_policy_ == FEC_ALARM_TRIGGER && !is_fec_timeout) {
+ ResetFecGroup();
+ } else {
+ // TODO(jri): SerializeFec can return a NULL packet, and this should cause
+ // an early return, with a call to delegate_->OnPacketGenerationError.
+ char buffer[kMaxPacketSize];
+ SerializedPacket serialized_fec =
+ packet_creator_.SerializeFec(buffer, kMaxPacketSize);
+ DCHECK(serialized_fec.packet);
+ delegate_->OnSerializedPacket(serialized_fec);
+ }
}
- // If we want to send FEC packet only when FEC alaram goes off and if it is
- // not a FEC timeout then close the group and dont send FEC packet.
- if (fec_send_policy_ == FEC_ALARM_TRIGGER && !is_fec_timeout) {
- ResetFecGroup();
- } else {
- // TODO(jri): SerializeFec can return a NULL packet, and this should
- // cause an early return, with a call to delegate_->OnPacketGenerationError.
- char buffer[kMaxPacketSize];
- SerializedPacket serialized_fec =
- packet_creator_.SerializeFec(buffer, kMaxPacketSize);
- DCHECK(serialized_fec.packet);
- delegate_->OnSerializedPacket(serialized_fec);
- }
// Turn FEC protection off if creator's protection is on and the creator
// does not have an open FEC group.
// Note: We only wait until the frames queued in the creator are flushed;
// pending frames in the generator will not keep us from turning FEC off.
- if (!should_fec_protect_ && !packet_creator_.IsFecGroupOpen()) {
+ if (!should_fec_protect_ && packet_creator_.IsFecProtected() &&
+ !packet_creator_.IsFecGroupOpen()) {
packet_creator_.StopFecProtectingPackets();
DCHECK(!packet_creator_.IsFecProtected());
}
« no previous file with comments | « net/quic/quic_packet_creator.cc ('k') | net/quic/quic_packet_generator_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698