diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 17:26:36 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-10 17:26:36 +0000 |
commit | b47c97ca765ca984940b8e775a25a50d6d815c43 (patch) | |
tree | 22ac0cf07e28a921f0a25b5830a2300e1e31a0be /net/flip/flip_framer.cc | |
parent | b2c4a4854eadf740c077bed4359def374dd7ad65 (diff) | |
download | chromium_src-b47c97ca765ca984940b8e775a25a50d6d815c43.zip chromium_src-b47c97ca765ca984940b8e775a25a50d6d815c43.tar.gz chromium_src-b47c97ca765ca984940b8e775a25a50d6d815c43.tar.bz2 |
Pickup some server nits from the checkin on the GFE side.
No significant code changes here, just some renames, minor
reworkings and comment additions.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/372074
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip/flip_framer.cc')
-rw-r--r-- | net/flip/flip_framer.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/flip/flip_framer.cc b/net/flip/flip_framer.cc index e1760a4..dba9574 100644 --- a/net/flip/flip_framer.cc +++ b/net/flip/flip_framer.cc @@ -14,7 +14,7 @@ namespace flip { // The initial size of the control frame buffer; this is used internally -// as we we parse though control frames. +// as we parse through control frames. static const size_t kControlFrameBufferInitialSize = 32 * 1024; // The maximum size of the control frame buffer that we support. // TODO(mbelshe): We should make this stream-based so there are no limits. @@ -240,9 +240,9 @@ size_t FlipFramer::ProcessCommonHeader(const char* data, size_t len) { } void FlipFramer::ProcessControlFrameHeader() { - FlipControlFrame current_control_frame(current_frame_buffer_, false); DCHECK_EQ(FLIP_NO_ERROR, error_code_); DCHECK_LE(FlipFrame::size(), current_frame_len_); + FlipControlFrame current_control_frame(current_frame_buffer_, false); // Do some sanity checking on the control frame sizes. switch (current_control_frame.type()) { case SYN_STREAM: @@ -261,7 +261,7 @@ void FlipFramer::ProcessControlFrameHeader() { set_error(FLIP_INVALID_CONTROL_FRAME); break; case NOOP: - // NOP. Swallow it. + // NOOP. Swallow it. CHANGE_STATE(FLIP_AUTO_RESET); return; default: @@ -340,7 +340,7 @@ size_t FlipFramer::ProcessDataFramePayload(const char* data, size_t len) { int rv = inflate(decompressor_.get(), Z_SYNC_FLUSH); if (rv != Z_OK) { set_error(FLIP_DECOMPRESS_FAILURE); - goto bottom; + return 0; } size_t decompressed_size = decompressed_max_size - decompressor_->avail_out; @@ -371,8 +371,6 @@ size_t FlipFramer::ProcessDataFramePayload(const char* data, size_t len) { } else { CHANGE_STATE(FLIP_AUTO_RESET); } - - bottom: return original_len - len; } @@ -458,9 +456,10 @@ FlipSynStreamControlFrame* FlipFramer::CreateSynStream( frame.WriteBytesToOffset(4, &flags_length, sizeof(flags_length)); scoped_ptr<FlipFrame> syn_frame(frame.take()); - if (compressed) + if (compressed) { return reinterpret_cast<FlipSynStreamControlFrame*>( CompressFrame(syn_frame.get())); + } return reinterpret_cast<FlipSynStreamControlFrame*>(syn_frame.release()); } @@ -504,9 +503,10 @@ FlipSynReplyControlFrame* FlipFramer::CreateSynReply(FlipStreamId stream_id, frame.WriteBytesToOffset(4, &flags_length, sizeof(flags_length)); scoped_ptr<FlipFrame> reply_frame(frame.take()); - if (compressed) + if (compressed) { return reinterpret_cast<FlipSynReplyControlFrame*>( CompressFrame(reply_frame.get())); + } return reinterpret_cast<FlipSynReplyControlFrame*>(reply_frame.release()); } |