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

Side by Side Diff: net/quic/quic_http_stream.cc

Issue 1576353011: QUIC - When write fails durin sending headers (WriteHeaders call) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 4 years, 11 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/quic/quic_network_transaction_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/quic/quic_http_stream.h" 5 #include "net/quic/quic_http_stream.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 headers_bytes_sent_ += frame_len; 442 headers_bytes_sent_ += frame_len;
443 443
444 request_headers_.clear(); 444 request_headers_.clear();
445 return static_cast<int>(frame_len); 445 return static_cast<int>(frame_len);
446 } 446 }
447 447
448 int QuicHttpStream::DoSendHeadersComplete(int rv) { 448 int QuicHttpStream::DoSendHeadersComplete(int rv) {
449 if (rv < 0) 449 if (rv < 0)
450 return rv; 450 return rv;
451 451
452 // If the stream is already closed, don't read the request the body.
453 if (!stream_)
454 return response_status_;
455
452 next_state_ = request_body_stream_ ? STATE_READ_REQUEST_BODY : STATE_OPEN; 456 next_state_ = request_body_stream_ ? STATE_READ_REQUEST_BODY : STATE_OPEN;
453 457
454 return OK; 458 return OK;
455 } 459 }
456 460
457 int QuicHttpStream::DoReadRequestBody() { 461 int QuicHttpStream::DoReadRequestBody() {
458 next_state_ = STATE_READ_REQUEST_BODY_COMPLETE; 462 next_state_ = STATE_READ_REQUEST_BODY_COMPLETE;
459 return request_body_stream_->Read( 463 return request_body_stream_->Read(
460 raw_request_body_buf_.get(), raw_request_body_buf_->size(), 464 raw_request_body_buf_.get(), raw_request_body_buf_->size(),
461 base::Bind(&QuicHttpStream::OnIOComplete, weak_factory_.GetWeakPtr())); 465 base::Bind(&QuicHttpStream::OnIOComplete, weak_factory_.GetWeakPtr()));
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); 559 closed_stream_sent_bytes_ = stream_->stream_bytes_written();
556 stream_ = nullptr; 560 stream_ = nullptr;
557 561
558 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress 562 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress
559 // read. 563 // read.
560 if (request_body_stream_) 564 if (request_body_stream_)
561 request_body_stream_->Reset(); 565 request_body_stream_->Reset();
562 } 566 }
563 567
564 } // namespace net 568 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698