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

Unified Diff: net/quic/chromium/bidirectional_stream_quic_impl.cc

Issue 2918663002: Clean up error handling in BidirectionalStreamQuicImpl::Start (Closed)
Patch Set: Fix test Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/bidirectional_stream_quic_impl.cc
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl.cc b/net/quic/chromium/bidirectional_stream_quic_impl.cc
index c3864fce8561b7ad838f3baef728c3a58ca391ac..5d2ae0445bd8c4126f750d7d803060f4cae81154 100644
--- a/net/quic/chromium/bidirectional_stream_quic_impl.cc
+++ b/net/quic/chromium/bidirectional_stream_quic_impl.cc
@@ -53,15 +53,10 @@ void BidirectionalStreamQuicImpl::Start(
std::unique_ptr<base::Timer> /* timer */) {
DCHECK(!stream_);
CHECK(delegate);
+ DLOG_IF(WARNING, !session_->IsConnected())
+ << "Trying to start request headers after session has been closed.";
send_request_headers_automatically_ = send_request_headers_automatically;
- if (!session_->IsConnected()) {
- NotifyError(session_->IsCryptoHandshakeConfirmed()
- ? ERR_QUIC_PROTOCOL_ERROR
- : ERR_QUIC_HANDSHAKE_FAILED);
- return;
- }
-
delegate_ = delegate;
request_info_ = request_info;
@@ -72,11 +67,17 @@ void BidirectionalStreamQuicImpl::Start(
if (rv == ERR_IO_PENDING)
return;
- if (rv == OK) {
- OnStreamReady(rv);
- } else if (!session_->IsCryptoHandshakeConfirmed()) {
- NotifyError(ERR_QUIC_HANDSHAKE_FAILED);
+ if (rv != OK) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&BidirectionalStreamQuicImpl::NotifyError,
+ weak_factory_.GetWeakPtr(),
+ session_->IsCryptoHandshakeConfirmed()
+ ? rv
+ : ERR_QUIC_HANDSHAKE_FAILED));
+ return;
}
+
+ OnStreamReady(rv);
}
void BidirectionalStreamQuicImpl::SendRequestHeaders() {
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698