summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_packet_creator.cc
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-04 21:13:09 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-04 21:13:09 +0000
commit059cad597aa1bbce0e153b326eae9968aff59b85 (patch)
tree115e0e94c47bc648d8a67e6d94eb20d9bfb5a58a /net/quic/quic_packet_creator.cc
parentd0ec6c4ffc55bc9e87acac823143fedf4b4f7b5d (diff)
downloadchromium_src-059cad597aa1bbce0e153b326eae9968aff59b85.zip
chromium_src-059cad597aa1bbce0e153b326eae9968aff59b85.tar.gz
chromium_src-059cad597aa1bbce0e153b326eae9968aff59b85.tar.bz2
Land Recent QUIC changes.
Merge internal change: 47341065 Fix to ensure the version matches before declaring that the public header flags exceed the max value. b/9190456 Merge internal change: 47324563 Fixing another backup bug (exposed by the last fix) that if we failed to write a standalone fin the stream would not be marked as write blocked. Merge internal change: 47272116 Don't add QuicStreams to ActiveSessionList; Instead call DumpSession on alive streams via QuicSession. Merge internal change: 47226512 Making the packet sequence number variable length to minimize bytes on the wire. Merge internal change: 47220850 Fixing a bug in quic stream where we'd send rst stream packets for successful streams. The fin bit should be sufficient for both good request/response pairs and early response pairs. Merge internal change: 47086343 Don't let FEC packets consume congestion window forever. If a FEC packet is not acked after a certain time, it is cleared from the congestion window. This timeout is higher than normal RTO. Merge internal change: 47056082 Add QuicSession to ActiveSessionList. Merge internal change: 47048300 Fixing a backup/resumption bug in QUIC. It's possible to have a full congestion window worth of packets on the wire. If we are in this state and a session tries to SendStreamData, the QuicPacketGenerator short-circuits without queuing packets because it checks to see if the connection CanWrite. When we get an ack, we check to see if we have locally queued packets, but never call OnCanWrite on the session to clear any streams which write blocked without queueing packets. Merge internal change: 47000173 QUIC: wire up the server-nonce parameters to the server config. Merge internal change: 46985067 R=rch@chromium.org Review URL: https://codereview.chromium.org/16256017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204046 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_packet_creator.cc')
-rw-r--r--net/quic/quic_packet_creator.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc
index c8d132f..d1c3ca1 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -30,6 +30,7 @@ QuicPacketCreator::QuicPacketCreator(QuicGuid guid,
send_version_in_packet_(!is_server),
packet_size_(GetPacketHeaderSize(options_.send_guid_length,
send_version_in_packet_,
+ options_.send_sequence_number_length,
NOT_IN_FEC_GROUP)) {
framer_->set_fec_builder(this);
}
@@ -58,6 +59,7 @@ void QuicPacketCreator::MaybeStartFEC() {
fec_group_.reset(new QuicFecGroup());
packet_size_ = GetPacketHeaderSize(options_.send_guid_length,
send_version_in_packet_,
+ options_.send_sequence_number_length,
IN_FEC_GROUP);
DCHECK_LE(packet_size_, options_.max_packet_length);
}
@@ -84,8 +86,10 @@ size_t QuicPacketCreator::StreamFramePacketOverhead(
int num_frames,
QuicGuidLength guid_length,
bool include_version,
+ QuicSequenceNumberLength sequence_number_length,
InFecGroup is_in_fec_group) {
- return GetPacketHeaderSize(guid_length, include_version, is_in_fec_group) +
+ return GetPacketHeaderSize(guid_length, include_version,
+ sequence_number_length, is_in_fec_group) +
QuicFramer::GetMinStreamFrameSize() * num_frames;
}
@@ -96,7 +100,8 @@ size_t QuicPacketCreator::CreateStreamFrame(QuicStreamId id,
QuicFrame* frame) {
DCHECK_GT(options_.max_packet_length,
StreamFramePacketOverhead(
- 1, PACKET_8BYTE_GUID, kIncludeVersion, IN_FEC_GROUP));
+ 1, PACKET_8BYTE_GUID, kIncludeVersion,
+ PACKET_6BYTE_SEQUENCE_NUMBER, IN_FEC_GROUP));
DCHECK(HasRoomForStreamFrame());
const size_t free_bytes = BytesFree();
@@ -160,6 +165,7 @@ SerializedPacket QuicPacketCreator::SerializePacket() {
queued_frames_.clear();
packet_size_ = GetPacketHeaderSize(options_.send_guid_length,
send_version_in_packet_,
+ options_.send_sequence_number_length,
fec_group_.get() != NULL ?
IN_FEC_GROUP : NOT_IN_FEC_GROUP);
serialized.retransmittable_frames = queued_retransmittable_frames_.release();
@@ -181,6 +187,7 @@ SerializedPacket QuicPacketCreator::SerializeFec() {
// Reset packet_size_, since the next packet may not have an FEC group.
packet_size_ = GetPacketHeaderSize(options_.send_guid_length,
send_version_in_packet_,
+ options_.send_sequence_number_length,
NOT_IN_FEC_GROUP);
DCHECK(serialized.packet);
DCHECK_GE(options_.max_packet_length, serialized.packet->length());