aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/include')
-rw-r--r--contrib/epee/include/net/abstract_tcp_server2.inl8
-rw-r--r--contrib/epee/include/storages/portable_storage_template_helper.h4
2 files changed, 10 insertions, 2 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl
index 698e1947a..1c854dfb7 100644
--- a/contrib/epee/include/net/abstract_tcp_server2.inl
+++ b/contrib/epee/include/net/abstract_tcp_server2.inl
@@ -1005,6 +1005,12 @@ POP_WARNINGS
while(local_shared_context->ec == boost::asio::error::would_block)
{
bool r = local_shared_context->cond.timed_wait(lock, boost::get_system_time() + boost::posix_time::milliseconds(conn_timeout));
+ if (m_stop_signal_sent)
+ {
+ if (sock_.is_open())
+ sock_.close();
+ return false;
+ }
if(local_shared_context->ec == boost::asio::error::would_block && !r)
{
//timeout
@@ -1018,6 +1024,8 @@ POP_WARNINGS
if (ec || !sock_.is_open())
{
_dbg3("Some problems at connect, message: " << ec.message());
+ if (sock_.is_open())
+ sock_.close();
return false;
}
diff --git a/contrib/epee/include/storages/portable_storage_template_helper.h b/contrib/epee/include/storages/portable_storage_template_helper.h
index 88515b5c3..bbd8413fc 100644
--- a/contrib/epee/include/storages/portable_storage_template_helper.h
+++ b/contrib/epee/include/storages/portable_storage_template_helper.h
@@ -72,7 +72,7 @@ namespace epee
{
std::string json_buff;
store_t_to_json(str_in, json_buff, indent, insert_newlines);
- return std::move(json_buff);
+ return json_buff;
}
//-----------------------------------------------------------------------------------------------------------
template<class t_struct>
@@ -117,7 +117,7 @@ namespace epee
{
std::string binary_buff;
store_t_to_binary(str_in, binary_buff, indent);
- return std::move(binary_buff);
+ return binary_buff;
}
}
}