asio: Set stream pointer to request and response in stream ctor
This commit is contained in:
parent
062b42918c
commit
9671eaa850
|
@ -355,12 +355,7 @@ stream *session_impl::create_push_stream(int32_t stream_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<stream> session_impl::create_stream() {
|
std::unique_ptr<stream> session_impl::create_stream() {
|
||||||
auto strm = make_unique<stream>(this);
|
return make_unique<stream>(this);
|
||||||
|
|
||||||
auto &req = strm->request().impl();
|
|
||||||
req.stream(strm.get());
|
|
||||||
|
|
||||||
return strm;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const request *session_impl::submit(boost::system::error_code &ec,
|
const request *session_impl::submit(boost::system::error_code &ec,
|
||||||
|
|
|
@ -32,7 +32,10 @@ namespace nghttp2 {
|
||||||
namespace asio_http2 {
|
namespace asio_http2 {
|
||||||
namespace client {
|
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); }
|
void stream::cancel() { sess_->cancel(*this); }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue