diff --git a/contrib/epee/include/net/connection_basic.hpp b/contrib/epee/include/net/connection_basic.hpp index 3a30e7443..fc0365034 100644 --- a/contrib/epee/include/net/connection_basic.hpp +++ b/contrib/epee/include/net/connection_basic.hpp @@ -96,7 +96,6 @@ class connection_basic_pimpl; // PIMPL for this class e_connection_type_P2P = 2 // to other p2p node (probably limited) }; - std::string to_string(t_connection_type type); class connection_basic { // not-templated base class for rapid development of some code parts // beware of removing const, net_utils::connection is sketchily doing a cast to prevent storing ptr twice @@ -165,8 +164,6 @@ class connection_basic { // not-templated base class for rapid development of so } // various handlers to be called from connection class: - void do_send_handler_write(const void * ptr , size_t cb); - void do_send_handler_write_from_queue(const boost::system::error_code& e, size_t cb , int q_len); // from handle_write, sending next part void logger_handle_net_write(size_t size); // network data written void logger_handle_net_read(size_t size); // network data read @@ -183,7 +180,6 @@ class connection_basic { // not-templated base class for rapid development of so static int get_tos_flag(); // handlers and sleep - void sleep_before_packet(size_t packet_size, int phase, int q_len); // execute a sleep ; phase is not really used now(?) static double get_sleep_time(size_t cb); }; diff --git a/contrib/epee/include/net/levin_base.h b/contrib/epee/include/net/levin_base.h index 404c06538..8b33b1672 100644 --- a/contrib/epee/include/net/levin_base.h +++ b/contrib/epee/include/net/levin_base.h @@ -43,20 +43,6 @@ namespace epee class byte_slice; namespace levin { -#pragma pack(push) -#pragma pack(1) - struct bucket_head - { - uint64_t m_signature; - uint64_t m_cb; - uint8_t m_have_to_return_data; - uint32_t m_command; - int32_t m_return_code; - uint32_t m_reservedA; //probably some flags in future - uint32_t m_reservedB; //probably some check sum in future - }; -#pragma pack(pop) - #pragma pack(push) #pragma pack(1) @@ -83,7 +69,6 @@ constexpr const std::chrono::milliseconds LEVIN_DEFAULT_TIMEOUT_PRECONFIGURED{0} #define LEVIN_PACKET_END 0x00000008 -#define LEVIN_PROTOCOL_VER_0 0 #define LEVIN_PROTOCOL_VER_1 1 diff --git a/contrib/epee/include/net/net_utils_base.h b/contrib/epee/include/net/net_utils_base.h index c52791344..595ad9056 100644 --- a/contrib/epee/include/net/net_utils_base.h +++ b/contrib/epee/include/net/net_utils_base.h @@ -471,18 +471,14 @@ inline MAKE_LOGGABLE(connection_context_base, ct, os) #define LOG_INFO_CC(ct, message) MINFO(ct << message) #define LOG_DEBUG_CC(ct, message) MDEBUG(ct << message) #define LOG_TRACE_CC(ct, message) MTRACE(ct << message) -#define LOG_CC(level, ct, message) MLOG(level, ct << message) #define LOG_PRINT_CC_L0(ct, message) LOG_PRINT_L0(ct << message) #define LOG_PRINT_CC_L1(ct, message) LOG_PRINT_L1(ct << message) #define LOG_PRINT_CC_L2(ct, message) LOG_PRINT_L2(ct << message) -#define LOG_PRINT_CC_L3(ct, message) LOG_PRINT_L3(ct << message) -#define LOG_PRINT_CC_L4(ct, message) LOG_PRINT_L4(ct << message) #define LOG_PRINT_CCONTEXT_L0(message) LOG_PRINT_CC_L0(context, message) #define LOG_PRINT_CCONTEXT_L1(message) LOG_PRINT_CC_L1(context, message) #define LOG_PRINT_CCONTEXT_L2(message) LOG_PRINT_CC_L2(context, message) -#define LOG_PRINT_CCONTEXT_L3(message) LOG_PRINT_CC_L3(context, message) #define LOG_ERROR_CCONTEXT(message) LOG_ERROR_CC(context, message) #define CHECK_AND_ASSERT_MES_CC(condition, return_val, err_message) CHECK_AND_ASSERT_MES(condition, return_val, "[" << epee::net_utils::print_connection_context_short(context) << "]" << err_message) diff --git a/contrib/epee/include/net/network_throttle.hpp b/contrib/epee/include/net/network_throttle.hpp index 444a72f36..b3784dac6 100644 --- a/contrib/epee/include/net/network_throttle.hpp +++ b/contrib/epee/include/net/network_throttle.hpp @@ -75,7 +75,6 @@ namespace net_utils typedef double network_speed_kbps; // externally, for parameters and return values, all defined in kilobytes per second typedef double network_speed_bps; // throttle-internally, bytes per second typedef double network_time_seconds; -typedef double network_MB; class i_network_throttle; diff --git a/contrib/epee/include/profile_tools.h b/contrib/epee/include/profile_tools.h index 76f794a36..2872a429d 100644 --- a/contrib/epee/include/profile_tools.h +++ b/contrib/epee/include/profile_tools.h @@ -53,19 +53,12 @@ namespace epee #define PROFILE_FUNC_THIRD(immortal_ptr_str) #endif -#define START_WAY_POINTS() uint64_t _____way_point_time = epee::misc_utils::get_tick_count(); -#define WAY_POINT(name) {uint64_t delta = epee::misc_utils::get_tick_count()-_____way_point_time; MDEBUG("Way point " << name << ": " << delta);_____way_point_time = misc_utils::get_tick_count();} -#define WAY_POINT2(name, avrg_obj) {uint64_t delta = epee::misc_utils::get_tick_count()-_____way_point_time; avrg_obj.push(delta); MDEBUG("Way point " << name << ": " << delta);_____way_point_time = misc_utils::get_tick_count();} #define TIME_MEASURE_START(var_name) uint64_t var_name = epee::misc_utils::get_tick_count(); -#define TIME_MEASURE_PAUSE(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; -#define TIME_MEASURE_RESTART(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; #define TIME_MEASURE_FINISH(var_name) var_name = epee::misc_utils::get_tick_count() - var_name; #define TIME_MEASURE_NS_START(var_name) uint64_t var_name = epee::misc_utils::get_ns_count(); -#define TIME_MEASURE_NS_PAUSE(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; -#define TIME_MEASURE_NS_RESTART(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; #define TIME_MEASURE_NS_FINISH(var_name) var_name = epee::misc_utils::get_ns_count() - var_name; namespace profile_tools diff --git a/contrib/epee/include/storages/portable_storage_base.h b/contrib/epee/include/storages/portable_storage_base.h index c15c9b826..8d13172c8 100644 --- a/contrib/epee/include/storages/portable_storage_base.h +++ b/contrib/epee/include/storages/portable_storage_base.h @@ -160,7 +160,6 @@ namespace epee typedef boost::variant storage_entry; - typedef std::string binarybuffer;//it's ok /************************************************************************/ /* */ diff --git a/contrib/epee/include/storages/portable_storage_from_bin.h b/contrib/epee/include/storages/portable_storage_from_bin.h index fb1ab6888..1dd3c3949 100644 --- a/contrib/epee/include/storages/portable_storage_from_bin.h +++ b/contrib/epee/include/storages/portable_storage_from_bin.h @@ -83,8 +83,6 @@ namespace epee void read(section& sec); void read(std::string& str); void read(array_entry &ae); - template - size_t min_bytes() const; void set_limits(size_t objects, size_t fields, size_t strings); private: struct recursuion_limitation_guard diff --git a/contrib/epee/src/connection_basic.cpp b/contrib/epee/src/connection_basic.cpp index c1f9f8cf9..16004d510 100644 --- a/contrib/epee/src/connection_basic.cpp +++ b/contrib/epee/src/connection_basic.cpp @@ -67,21 +67,6 @@ namespace } } - std::string to_string(t_connection_type type) - { - if (type == e_connection_type_NET) - return std::string("NET"); - else if (type == e_connection_type_RPC) - return std::string("RPC"); - else if (type == e_connection_type_P2P) - return std::string("P2P"); - - return std::string("UNKNOWN"); - } - - -/* ============================================================================ */ - class connection_basic_pimpl { public: connection_basic_pimpl(const std::string &name); @@ -222,46 +207,6 @@ int connection_basic::get_tos_flag() { return connection_basic_pimpl::m_default_tos; } -void connection_basic::sleep_before_packet(size_t packet_size, int phase, int q_len) { - double delay=0; // will be calculated - do - { // rate limiting - if (m_was_shutdown) { - _dbg2("m_was_shutdown - so abort sleep"); - return; - } - - { - CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_out ); - delay = network_throttle_manager::get_global_throttle_out().get_sleep_time_after_tick( packet_size ); - } - - delay *= 0.50; - if (delay > 0) { - long int ms = (long int)(delay * 1000); - MTRACE("Sleeping in " << __FUNCTION__ << " for " << ms << " ms before packet_size="< 0); - -// XXX LATER XXX - { - CRITICAL_REGION_LOCAL( network_throttle_manager::m_lock_get_global_throttle_out ); - network_throttle_manager::get_global_throttle_out().handle_trafic_exact( packet_size ); // increase counter - global - } - -} - -void connection_basic::do_send_handler_write(const void* ptr , size_t cb ) { - // No sleeping here; sleeping is done once and for all in connection::handle_write - MTRACE("handler_write (direct) - before ASIO write, for packet="<::handle_write - MTRACE("handler_write (after write, from queue="<