Chromium Code Reviews| Index: net/quic/bidirectional_stream_quic_impl.cc |
| diff --git a/net/quic/bidirectional_stream_quic_impl.cc b/net/quic/bidirectional_stream_quic_impl.cc |
| index 25154b40cf79bd238275053969faf8d8bf88333b..d8c106c29fd11c52ce8c22ca1b9704958f903fd3 100644 |
| --- a/net/quic/bidirectional_stream_quic_impl.cc |
| +++ b/net/quic/bidirectional_stream_quic_impl.cc |
| @@ -33,6 +33,7 @@ BidirectionalStreamQuicImpl::BidirectionalStreamQuicImpl( |
| has_sent_headers_(false), |
| has_received_headers_(false), |
| send_request_headers_automatically_(true), |
| + waiting_for_confirmation_(false), |
| weak_factory_(this) { |
| DCHECK(session_); |
| session_->AddObserver(this); |
| @@ -281,6 +282,8 @@ bool BidirectionalStreamQuicImpl::HasSendHeadersComplete() { |
| void BidirectionalStreamQuicImpl::OnCryptoHandshakeConfirmed() { |
| was_handshake_confirmed_ = true; |
| + if (waiting_for_confirmation_) |
| + StartStream(); |
| } |
| void BidirectionalStreamQuicImpl::OnSessionClosed( |
| @@ -296,16 +299,24 @@ void BidirectionalStreamQuicImpl::OnStreamReady(int rv) { |
| DCHECK(rv == OK || !stream_); |
| if (rv == OK) { |
| stream_->SetDelegate(this); |
| - if (send_request_headers_automatically_) { |
| - SendRequestHeaders(); |
| + if (!was_handshake_confirmed_ && request_info_->method == "POST") { |
|
xunjieli
2016/06/16 22:52:13
If |was_handshake_confirmed_| is false and method
xunjieli
2016/06/17 01:31:46
Ah, nvm. It won't happen. I was reading the code w
|
| + waiting_for_confirmation_ = true; |
| + return; |
| } |
| - if (delegate_) |
| - delegate_->OnStreamReady(has_sent_headers_); |
| + StartStream(); |
| } else { |
| NotifyError(rv); |
| } |
| } |
| +void BidirectionalStreamQuicImpl::StartStream() { |
| + if (send_request_headers_automatically_) { |
| + SendRequestHeaders(); |
| + } |
| + if (delegate_) |
| + delegate_->OnStreamReady(has_sent_headers_); |
| +} |
| + |
| void BidirectionalStreamQuicImpl::OnSendDataComplete(int rv) { |
| DCHECK(rv == OK || !stream_); |
| if (rv == OK) { |