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

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

Issue 2035643002: Introduce error handling in QuicHttpStream on UploadDataStream::Read() failure. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed test upload_data_stream file from the patch used to run try bots in patch 1 Created 4 years, 6 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_http_stream_test.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/string_split.h" 9 #include "base/strings/string_split.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 int QuicHttpStream::DoReadRequestBody() { 661 int QuicHttpStream::DoReadRequestBody() {
662 next_state_ = STATE_READ_REQUEST_BODY_COMPLETE; 662 next_state_ = STATE_READ_REQUEST_BODY_COMPLETE;
663 return request_body_stream_->Read( 663 return request_body_stream_->Read(
664 raw_request_body_buf_.get(), raw_request_body_buf_->size(), 664 raw_request_body_buf_.get(), raw_request_body_buf_->size(),
665 base::Bind(&QuicHttpStream::OnIOComplete, weak_factory_.GetWeakPtr())); 665 base::Bind(&QuicHttpStream::OnIOComplete, weak_factory_.GetWeakPtr()));
666 } 666 }
667 667
668 int QuicHttpStream::DoReadRequestBodyComplete(int rv) { 668 int QuicHttpStream::DoReadRequestBodyComplete(int rv) {
669 // |rv| is the result of read from the request body from the last call to 669 // |rv| is the result of read from the request body from the last call to
670 // DoSendBody(). 670 // DoSendBody().
671 if (rv < 0) 671 if (rv < 0) {
672 if (!callback_.is_null())
673 DoCallback(rv);
mmenke 2016/06/02 15:17:58 I don't think you need to invoke the callback here
maksims (do not use this acc) 2016/06/03 09:40:31 Done.
674 stream_->Reset(QUIC_ERROR_PROCESSING_STREAM);
672 return rv; 675 return rv;
676 }
673 677
674 // If the stream is already closed, don't continue. 678 // If the stream is already closed, don't continue.
675 if (!stream_) 679 if (!stream_)
676 return response_status_; 680 return response_status_;
mmenke 2016/06/02 15:17:58 This should go before the rv check - if this happe
maksims (do not use this acc) 2016/06/03 09:40:31 Done.
677 681
678 request_body_buf_ = new DrainableIOBuffer(raw_request_body_buf_.get(), rv); 682 request_body_buf_ = new DrainableIOBuffer(raw_request_body_buf_.get(), rv);
679 if (rv == 0) { // Reached the end. 683 if (rv == 0) { // Reached the end.
680 DCHECK(request_body_stream_->IsEOF()); 684 DCHECK(request_body_stream_->IsEOF());
681 } 685 }
682 686
683 next_state_ = STATE_SEND_BODY; 687 next_state_ = STATE_SEND_BODY;
684 return OK; 688 return OK;
685 } 689 }
686 690
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
772 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); 776 closed_stream_sent_bytes_ = stream_->stream_bytes_written();
773 stream_ = nullptr; 777 stream_ = nullptr;
774 778
775 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress 779 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress
776 // read. 780 // read.
777 if (request_body_stream_) 781 if (request_body_stream_)
778 request_body_stream_->Reset(); 782 request_body_stream_->Reset();
779 } 783 }
780 784
781 } // namespace net 785 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698