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_server.h2
-rw-r--r--contrib/epee/include/net/abstract_tcp_server2.inl12
-rw-r--r--contrib/epee/include/net/http_protocol_handler.inl7
-rw-r--r--contrib/epee/include/net/net_parse_helpers.h4
-rw-r--r--contrib/epee/include/net/network_throttle.hpp2
-rw-r--r--contrib/epee/include/string_tools.h2
6 files changed, 21 insertions, 8 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server.h b/contrib/epee/include/net/abstract_tcp_server.h
index 000305cfa..cbad1717c 100644
--- a/contrib/epee/include/net/abstract_tcp_server.h
+++ b/contrib/epee/include/net/abstract_tcp_server.h
@@ -305,7 +305,7 @@ namespace net_utils
m_connections.back().powner = this;
m_connections.back().m_self_it = --m_connections.end();
m_connections.back().m_context.m_remote_address = remote_address;
- m_connections.back().m_htread = threads_helper::create_thread(ConnectionHandlerProc, &m_connections.back());
+ m_connections.back().m_htread = threads_helper::create_thread(ConnectionHandlerProc, &m_connections.back()); // ugh, seems very risky
return true;
}
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl
index 04d884af2..870f6c2b2 100644
--- a/contrib/epee/include/net/abstract_tcp_server2.inl
+++ b/contrib/epee/include/net/abstract_tcp_server2.inl
@@ -735,7 +735,17 @@ PRAGMA_WARNING_DISABLE_VS(4355)
boost::asio::placeholders::error));
return true;
- CATCH_ENTRY_L0("boosted_tcp_server<t_protocol_handler>::init_server", false);
+ }
+ catch (const std::exception &e)
+ {
+ MFATAL("Error starting server: " << e.what());
+ return false;
+ }
+ catch (...)
+ {
+ MFATAL("Error starting server");
+ return false;
+ }
}
//-----------------------------------------------------------------------------
PUSH_WARNINGS
diff --git a/contrib/epee/include/net/http_protocol_handler.inl b/contrib/epee/include/net/http_protocol_handler.inl
index c555707ac..c18f7f706 100644
--- a/contrib/epee/include/net/http_protocol_handler.inl
+++ b/contrib/epee/include/net/http_protocol_handler.inl
@@ -345,7 +345,12 @@ namespace net_utils
{
analize_http_method(result, m_query_info.m_http_method, m_query_info.m_http_ver_hi, m_query_info.m_http_ver_hi);
m_query_info.m_URI = result[10];
- parse_uri(m_query_info.m_URI, m_query_info.m_uri_content);
+ if (!parse_uri(m_query_info.m_URI, m_query_info.m_uri_content))
+ {
+ m_state = http_state_error;
+ MERROR("Failed to parse URI: m_query_info.m_URI");
+ return false;
+ }
m_query_info.m_http_method_str = result[2];
m_query_info.m_full_request_str = result[0];
diff --git a/contrib/epee/include/net/net_parse_helpers.h b/contrib/epee/include/net/net_parse_helpers.h
index 08d2a2000..708cce0ff 100644
--- a/contrib/epee/include/net/net_parse_helpers.h
+++ b/contrib/epee/include/net/net_parse_helpers.h
@@ -103,7 +103,7 @@ namespace net_utils
STATIC_REGEXP_EXPR_1(rexp_match_uri, "^([^?#]*)(\\?([^#]*))?(#(.*))?", boost::regex::icase | boost::regex::normal);
boost::smatch result;
- if(!boost::regex_search(uri, result, rexp_match_uri, boost::match_default) && result[0].matched)
+ if(!(boost::regex_search(uri, result, rexp_match_uri, boost::match_default) && result[0].matched))
{
LOG_PRINT_L1("[PARSE URI] regex not matched for uri: " << uri);
content.m_path = uri;
@@ -139,7 +139,7 @@ namespace net_utils
// 12 34 5 6 7
content.port = 0;
boost::smatch result;
- if(!boost::regex_search(url_str, result, rexp_match_uri, boost::match_default) && result[0].matched)
+ if(!(boost::regex_search(url_str, result, rexp_match_uri, boost::match_default) && result[0].matched))
{
LOG_PRINT_L1("[PARSE URI] regex not matched for uri: " << rexp_match_uri);
//content.m_path = uri;
diff --git a/contrib/epee/include/net/network_throttle.hpp b/contrib/epee/include/net/network_throttle.hpp
index 464b34726..fffd22a6a 100644
--- a/contrib/epee/include/net/network_throttle.hpp
+++ b/contrib/epee/include/net/network_throttle.hpp
@@ -121,8 +121,6 @@ class network_throttle_manager {
friend class connection_basic; // FRIEND - to directly access global throttle-s. !! REMEMBER TO USE LOCKS!
friend class connection_basic_pimpl; // ditto
- static int xxx;
-
public:
static i_network_throttle & get_global_throttle_in(); ///< singleton ; for friend class ; caller MUST use proper locks! like m_lock_get_global_throttle_in
static i_network_throttle & get_global_throttle_inreq(); ///< ditto ; use lock ... use m_lock_get_global_throttle_inreq obviously
diff --git a/contrib/epee/include/string_tools.h b/contrib/epee/include/string_tools.h
index 307323aa1..5a1ef0743 100644
--- a/contrib/epee/include/string_tools.h
+++ b/contrib/epee/include/string_tools.h
@@ -161,7 +161,7 @@ DISABLE_GCC_WARNING(maybe-uninitialized)
val = boost::lexical_cast<XType>(str_id);
return true;
}
- catch(std::exception& /*e*/)
+ catch(const std::exception& /*e*/)
{
//const char* pmsg = e.what();
return false;