mirror of
https://github.com/boostorg/beast.git
synced 2025-08-02 06:15:24 +02:00
@@ -3,6 +3,7 @@ Version 223:
|
|||||||
* Add test::stream::service
|
* Add test::stream::service
|
||||||
* Add websocket service
|
* Add websocket service
|
||||||
* Pausation abandoning test
|
* Pausation abandoning test
|
||||||
|
* Destroy abandoned websocket ops on shutdown
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@@ -335,6 +335,8 @@
|
|||||||
* ([issue 1306]) `test::stream`
|
* ([issue 1306]) `test::stream`
|
||||||
has fewer dependencies
|
has fewer dependencies
|
||||||
|
|
||||||
|
* ([issue 1358]) Destroy abandoned websocket ops on shutdown
|
||||||
|
|
||||||
* ([issue 1365]) Handler wrappers decay parameters sooner
|
* ([issue 1365]) Handler wrappers decay parameters sooner
|
||||||
|
|
||||||
* ([issue 1408]) `session_alloc`
|
* ([issue 1408]) `session_alloc`
|
||||||
|
@@ -39,6 +39,16 @@ operator=(saved_handler&& other) noexcept
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
saved_handler::
|
||||||
|
reset() noexcept
|
||||||
|
{
|
||||||
|
if(! p_)
|
||||||
|
return false;
|
||||||
|
boost::exchange(p_, nullptr)->destroy();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
saved_handler::
|
saved_handler::
|
||||||
invoke()
|
invoke()
|
||||||
|
@@ -90,6 +90,16 @@ public:
|
|||||||
void
|
void
|
||||||
emplace(Handler&& handler);
|
emplace(Handler&& handler);
|
||||||
|
|
||||||
|
/** Discard the saved handler, if one exists.
|
||||||
|
|
||||||
|
If `*this` contains an object, it is destroyed.
|
||||||
|
|
||||||
|
@returns `true` if an object was destroyed.
|
||||||
|
*/
|
||||||
|
BOOST_BEAST_DECL
|
||||||
|
bool
|
||||||
|
reset() noexcept;
|
||||||
|
|
||||||
/** Unconditionally invoke the stored completion handler.
|
/** Unconditionally invoke the stored completion handler.
|
||||||
|
|
||||||
Requires `this->has_value() == true`. Any dynamic memory
|
Requires `this->has_value() == true`. Any dynamic memory
|
||||||
|
@@ -55,6 +55,10 @@ public:
|
|||||||
svc_.v_[index_] = &other;
|
svc_.v_[index_] = &other;
|
||||||
svc_.v_.pop_back();
|
svc_.v_.pop_back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual
|
||||||
|
void
|
||||||
|
shutdown() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -72,6 +76,9 @@ private:
|
|||||||
for(auto p : v_)
|
for(auto p : v_)
|
||||||
v.emplace_back(p->weak_from_this());
|
v.emplace_back(p->weak_from_this());
|
||||||
}
|
}
|
||||||
|
for(auto wp : v)
|
||||||
|
if(auto sp = wp.lock())
|
||||||
|
sp->shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -138,6 +138,18 @@ struct stream<NextLayer, deflateSupported>::impl_type
|
|||||||
timeout_opt.keep_alive_pings = false;
|
timeout_opt.keep_alive_pings = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
shutdown() override
|
||||||
|
{
|
||||||
|
op_rd.reset();
|
||||||
|
op_wr.reset();
|
||||||
|
op_ping.reset();
|
||||||
|
op_idle_ping.reset();
|
||||||
|
op_close.reset();
|
||||||
|
op_r_rd.reset();
|
||||||
|
op_r_close.reset();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
open(role_type role_)
|
open(role_type role_)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user