From 289b93d79e3e7a55553ae0c41fd48461e43e9d8e Mon Sep 17 00:00:00 2001 From: "mbelshe@google.com" Date: Tue, 20 Oct 2009 15:32:32 +0000 Subject: Fixup the flip_framer eof-handling semantics now that we have the FIN bit in place. The FlipFrameVisitor will always inject a zero-length data packet to the Visitor as a signal that the data stream is complete. Even if the FIN packet was set on a SYN_REPLY (e.g. there are no data packets), the FlipFramer will simulate a zero-length read to the caller. Likewise, zero-length reads are never sent to the visitor unless the FIN packet has been received. This means that the FlipFramer must swallow zero-length data packets. Also merged in changes from server. BUG=none TEST=flip_framer_test.cc Review URL: http://codereview.chromium.org/294015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29513 0039d316-1c4b-4281-b951-d872f2087c98 --- net/flip/flip_protocol.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'net/flip/flip_protocol.h') diff --git a/net/flip/flip_protocol.h b/net/flip/flip_protocol.h index c737473..8a585bc 100644 --- a/net/flip/flip_protocol.h +++ b/net/flip/flip_protocol.h @@ -89,23 +89,25 @@ const int kFlipProtocolVersion = 1; // accessors provided or call ntohX() functions. // Types of Flip Control Frames. -typedef enum { +enum FlipControlType { SYN_STREAM = 1, SYN_REPLY, FIN_STREAM, NOOP -} FlipControlType; +}; // Flags on data packets -typedef enum { +enum FlipDataFlags { + DATA_FLAG_NONE = 0, DATA_FLAG_FIN = 1, DATA_FLAG_COMPRESSED = 2 // TODO(mbelshe): remove me. -} FlipDataFlags; +}; // Flags on control packets -typedef enum { +enum FlipControlFlags { + CONTROL_FLAG_NONE = 0, CONTROL_FLAG_FIN = 1 -} FlipControlFlags; +}; // A FLIP stream id is a 31 bit entity. typedef uint32 FlipStreamId; @@ -115,10 +117,10 @@ typedef uint32 FlipStreamId; #define FLIP_PRIORITY_HIGHEST 0 // A special structure for the 8 bit flags and 24 bit length fields. -typedef union { +union FlagsAndLength { uint8 flags_[4]; // 8 bits uint32 length_; // 24 bits -} FlagsLength; +}; // All Flip Frame types derive from the FlipFrame struct. typedef struct { @@ -146,7 +148,7 @@ typedef struct { FlipStreamId stream_id_; } data_; }; - FlagsLength flags_length_; + FlagsAndLength flags_length_; } FlipFrame; // A Data Frame. -- cgit v1.1