int QuicHttpStream::SendRequest(const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
const CompletionCallback& callback) {
- CHECK(stream_);
CHECK(!request_body_stream_);
CHECK(!response_info_);
CHECK(!callback.is_null());
CHECK(response);
+ if (!stream_) {
+ return ERR_CONNECTION_CLOSED;
+ }
+
QuicPriority priority = ConvertRequestPriorityToQuicPriority(priority_);
stream_->set_priority(priority);
// Store the serialized request headers.
stream_->SetDelegate(NULL);
stream_->Reset(QUIC_STREAM_CANCELLED);
stream_ = NULL;
+ response_status_ = was_handshake_confirmed_ ?
+ ERR_CONNECTION_CLOSED : ERR_QUIC_HANDSHAKE_FAILED;
}
}
}
void QuicHttpStream::OnSessionClosed(int error) {
+ Close(false);
session_error_ = error;
session_.reset();
}