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

Side by Side Diff: net/spdy/buffered_spdy_framer.cc

Issue 2686613002: Cleanup control_frame_fields_ if coalescer rejected the headers. (Closed)
Patch Set: Apply review feedback. Created 3 years, 10 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/spdy/buffered_spdy_framer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/buffered_spdy_framer.h" 5 #include "net/spdy/buffered_spdy_framer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 SpdyStreamId stream_id) { 94 SpdyStreamId stream_id) {
95 coalescer_.reset(new HeaderCoalescer()); 95 coalescer_.reset(new HeaderCoalescer());
96 return coalescer_.get(); 96 return coalescer_.get();
97 } 97 }
98 98
99 void BufferedSpdyFramer::OnHeaderFrameEnd(SpdyStreamId stream_id, 99 void BufferedSpdyFramer::OnHeaderFrameEnd(SpdyStreamId stream_id,
100 bool end_headers) { 100 bool end_headers) {
101 if (coalescer_->error_seen()) { 101 if (coalescer_->error_seen()) {
102 visitor_->OnStreamError(stream_id, 102 visitor_->OnStreamError(stream_id,
103 "Could not parse Spdy Control Frame Header."); 103 "Could not parse Spdy Control Frame Header.");
104 control_frame_fields_.reset();
104 return; 105 return;
105 } 106 }
106 DCHECK(control_frame_fields_.get()); 107 DCHECK(control_frame_fields_.get());
107 switch (control_frame_fields_->type) { 108 switch (control_frame_fields_->type) {
108 case HEADERS: 109 case HEADERS:
109 visitor_->OnHeaders( 110 visitor_->OnHeaders(
110 control_frame_fields_->stream_id, control_frame_fields_->has_priority, 111 control_frame_fields_->stream_id, control_frame_fields_->has_priority,
111 control_frame_fields_->weight, 112 control_frame_fields_->weight,
112 control_frame_fields_->parent_stream_id, 113 control_frame_fields_->parent_stream_id,
113 control_frame_fields_->exclusive, control_frame_fields_->fin, 114 control_frame_fields_->exclusive, control_frame_fields_->fin,
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 336 }
336 337
337 void BufferedSpdyFramer::InitHeaderStreaming(SpdyStreamId stream_id) { 338 void BufferedSpdyFramer::InitHeaderStreaming(SpdyStreamId stream_id) {
338 header_buffer_.clear(); 339 header_buffer_.clear();
339 header_buffer_valid_ = true; 340 header_buffer_valid_ = true;
340 header_stream_id_ = stream_id; 341 header_stream_id_ = stream_id;
341 DCHECK_NE(header_stream_id_, SpdyFramer::kInvalidStream); 342 DCHECK_NE(header_stream_id_, SpdyFramer::kInvalidStream);
342 } 343 }
343 344
344 } // namespace net 345 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/spdy/buffered_spdy_framer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698