aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee')
-rw-r--r--contrib/epee/include/misc_log_ex.h2
-rw-r--r--contrib/epee/include/net/abstract_tcp_server2.inl6
-rw-r--r--contrib/epee/include/storages/parserse_base_utils.h6
-rw-r--r--contrib/epee/src/network_throttle-detail.cpp1
4 files changed, 11 insertions, 4 deletions
diff --git a/contrib/epee/include/misc_log_ex.h b/contrib/epee/include/misc_log_ex.h
index 530f8e636..9100a8db3 100644
--- a/contrib/epee/include/misc_log_ex.h
+++ b/contrib/epee/include/misc_log_ex.h
@@ -32,7 +32,9 @@
#include "easylogging++.h"
+#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "default"
+
#define MAX_LOG_FILE_SIZE 104850000 // 100 MB - 7600 bytes
#define MAX_LOG_FILES 50
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl
index 5dbb7a478..9b03941ee 100644
--- a/contrib/epee/include/net/abstract_tcp_server2.inl
+++ b/contrib/epee/include/net/abstract_tcp_server2.inl
@@ -393,7 +393,7 @@ PRAGMA_WARNING_DISABLE_VS(4355)
//ask it inside(!) critical region if we still able to go in event wait...
size_t cnt = socket_.get_io_service().poll_one();
if(!cnt)
- misc_utils::sleep_no_w(0);
+ misc_utils::sleep_no_w(1);
}
return true;
@@ -889,7 +889,9 @@ POP_WARNINGS
{
try
{
- io_service_.run();
+ size_t cnt = io_service_.run();
+ if (cnt == 0)
+ misc_utils::sleep_no_w(1);
}
catch(const std::exception& ex)
{
diff --git a/contrib/epee/include/storages/parserse_base_utils.h b/contrib/epee/include/storages/parserse_base_utils.h
index 8c6c1a64d..31495ae13 100644
--- a/contrib/epee/include/storages/parserse_base_utils.h
+++ b/contrib/epee/include/storages/parserse_base_utils.h
@@ -39,12 +39,14 @@ namespace misc_utils
inline std::string transform_to_escape_sequence(const std::string& src)
{
static const char escaped[] = "\b\f\n\r\t\v\"\\/";
- if (std::find_first_of(src.begin(), src.end(), escaped, escaped + sizeof(escaped)) == src.end())
+ std::string::const_iterator it = std::find_first_of(src.begin(), src.end(), escaped, escaped + sizeof(escaped));
+ if (it == src.end())
return src;
std::string res;
res.reserve(2 * src.size());
- for(std::string::const_iterator it = src.begin(); it!=src.end(); ++it)
+ res.assign(src.begin(), it);
+ for(; it!=src.end(); ++it)
{
switch(*it)
{
diff --git a/contrib/epee/src/network_throttle-detail.cpp b/contrib/epee/src/network_throttle-detail.cpp
index 28c85bb78..6f727a1cf 100644
--- a/contrib/epee/src/network_throttle-detail.cpp
+++ b/contrib/epee/src/network_throttle-detail.cpp
@@ -150,6 +150,7 @@ network_throttle::network_throttle(const std::string &nameshort, const std::stri
m_any_packet_yet = false;
m_slot_size = 1.0; // hard coded in few places
m_target_speed = 16 * 1024; // other defaults are probably defined in the command-line parsing code when this class is used e.g. as main global throttle
+ m_last_sample_time = 0;
}
void network_throttle::set_name(const std::string &name)