Skip to content

Commit

Permalink
Fix websocket variant_stream close in reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Nov 11, 2023
1 parent ca6fd84 commit 9ea8cb0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions animals/include/animals/uncia.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ namespace animals
// 重置, 用于重复使用应该对象.
inline void reset()
{
boost::variant2::visit([&](auto& t) mutable
{
try {
auto& next_layer = t->next_layer();
auto& stream = beast::get_lowest_layer(next_layer);
stream.close();
} catch (const std::exception&) {}
}, m_stream);
m_stream = variant_stream{};
m_url.clear();
}
Expand Down

0 comments on commit 9ea8cb0

Please sign in to comment.