diff --git a/src/asio_client_session_impl.cc b/src/asio_client_session_impl.cc index c0773270..5282e8cc 100644 --- a/src/asio_client_session_impl.cc +++ b/src/asio_client_session_impl.cc @@ -355,12 +355,7 @@ stream *session_impl::create_push_stream(int32_t stream_id) { } std::unique_ptr session_impl::create_stream() { - auto strm = make_unique(this); - - auto &req = strm->request().impl(); - req.stream(strm.get()); - - return strm; + return make_unique(this); } const request *session_impl::submit(boost::system::error_code &ec, diff --git a/src/asio_client_stream.cc b/src/asio_client_stream.cc index 60f5572b..e0ca9c41 100644 --- a/src/asio_client_stream.cc +++ b/src/asio_client_stream.cc @@ -32,7 +32,10 @@ namespace nghttp2 { namespace asio_http2 { namespace client { -stream::stream(session_impl *sess) : sess_(sess), stream_id_(0) {} +stream::stream(session_impl *sess) : sess_(sess), stream_id_(0) +{ + request_.impl().stream(this); +} void stream::cancel() { sess_->cancel(*this); }