summaryrefslogtreecommitdiffstats
path: root/net/quic/quic_packet_creator.h
diff options
context:
space:
mode:
authorrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 01:51:15 +0000
committerrtenneti@chromium.org <rtenneti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-28 01:51:15 +0000
commit583bcbcff1814196c2e7fa4b999712c3d66b126a (patch)
tree11b67f5bab0d47b8863b4ea05b4c9accd81f794e /net/quic/quic_packet_creator.h
parent963eac2fb452fe9b9c1ba69ddabb3d1a012eff20 (diff)
downloadchromium_src-583bcbcff1814196c2e7fa4b999712c3d66b126a.zip
chromium_src-583bcbcff1814196c2e7fa4b999712c3d66b126a.tar.gz
chromium_src-583bcbcff1814196c2e7fa4b999712c3d66b126a.tar.bz2
Land Recent QUIC changes.
Enables the padding of QUIC handshake packets to the max packet size. Does not pad packets which do not leave enough space to fit a padding frame after expanding the final stream frame. An alternative would be to add a new type of padding frame which could show up earlier in the packet, but this is good enough for now. flag to enable the padding of QUIC handshake packets to full size Merge internal change: 55118010 Add a set_seed method to the PacketDroppingTestWriter to facilitate reproducing test behavior. Merge internal change: 55107501 Consistently pass the IsHandshake flag to the congestion control algorithm in QUIC. Merge internal change: 55046282 The goal is parity between HTTP and QUIC testing. Merge internal change: 55000555 Fixed comments - found while back porting changes to server. Merge internal change: 54999641 Fix bug in QuicPacketCreator's packet size calculation when a stream frame is close to the maximum possible. Merge internal change: 54933729 Remove unused random_reorder field from QuicPacketCreator::Options Merge internal change: 54885136 Using GFE's IOVector to replace uses of struct iovec on the QUIC's Write path. Merge internal change: 54805402 R=rch@chromium.org Review URL: https://codereview.chromium.org/46903002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231278 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/quic/quic_packet_creator.h')
-rw-r--r--net/quic/quic_packet_creator.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index 643c45b..614ebbc 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -18,6 +18,8 @@
#include "net/quic/quic_framer.h"
#include "net/quic/quic_protocol.h"
+NET_EXPORT_PRIVATE extern bool FLAGS_pad_quic_handshake_packets;
+
namespace net {
namespace test {
class QuicPacketCreatorPeer;
@@ -32,13 +34,11 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
struct Options {
Options()
: max_packet_length(kMaxPacketSize),
- random_reorder(false),
max_packets_per_fec_group(0),
send_guid_length(PACKET_8BYTE_GUID),
send_sequence_number_length(PACKET_1BYTE_SEQUENCE_NUMBER) {}
size_t max_packet_length;
- bool random_reorder; // Inefficient: rewrite if used at scale.
// 0 indicates fec is disabled.
size_t max_packets_per_fec_group;
// Length of guid to send over the wire.
@@ -116,10 +116,16 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
// Returns true if there are frames pending to be serialized.
bool HasPendingFrames();
- // Returns the number of bytes which are free to frames in the current packet.
+ // Returns the number of bytes which are available to be used by additional
+ // frames in the packet. Since stream frames are slightly smaller when they
+ // are the last frame in a packet, this method will return a different
+ // value than max_packet_size - PacketSize(), in this case.
size_t BytesFree() const;
- // Returns the number of bytes in the current packet, including the header.
+ // Returns the number of bytes in the current packet, including the header,
+ // if serialized with the current frames. Adding a frame to the packet
+ // may change the serialized length of existing frames, as per the comment
+ // in BytesFree.
size_t PacketSize() const;
// Adds |frame| to the packet creator's list of frames to be serialized.
@@ -185,6 +191,11 @@ class NET_EXPORT_PRIVATE QuicPacketCreator : public QuicFecBuilderInterface {
// Particularly useful for retransmits using SerializeAllFrames().
bool AddFrame(const QuicFrame& frame, bool save_retransmittable_frames);
+ // Adds a padding frame to the current packet only if the current packet
+ // contains a handshake message, and there is sufficient room to fit a
+ // padding frame.
+ void MaybeAddPadding();
+
Options options_;
QuicGuid guid_;
QuicFramer* framer_;