Removed use of asio::socket::close due to segmentation fault when Config::thread_pool_size was larger than 1. See #239.
This commit is contained in:
parent
0f8f1f515b
commit
cfe98038ba
1 changed files with 1 additions and 3 deletions
|
|
@ -279,7 +279,6 @@ namespace SimpleWeb {
|
|||
std::shared_ptr<ScopeRunner> handler_runner;
|
||||
|
||||
std::unique_ptr<socket_type> socket; // Socket must be unique_ptr since asio::ssl::stream<asio::ip::tcp::socket> is not movable
|
||||
std::mutex socket_close_mutex;
|
||||
|
||||
std::unique_ptr<asio::steady_timer> timer;
|
||||
|
||||
|
|
@ -287,9 +286,8 @@ namespace SimpleWeb {
|
|||
|
||||
void close() noexcept {
|
||||
error_code ec;
|
||||
std::unique_lock<std::mutex> lock(socket_close_mutex); // The following operations seems to be needed to run sequentially
|
||||
socket->lowest_layer().shutdown(asio::ip::tcp::socket::shutdown_both, ec);
|
||||
socket->lowest_layer().close(ec);
|
||||
socket->lowest_layer().cancel(ec);
|
||||
}
|
||||
|
||||
void set_timeout(long seconds) noexcept {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue