From bb89ae8b2058d98a764f24e17e6c58089dd548f0 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 29 Nov 2017 19:30:06 +0000 Subject: [PATCH] move connection_basic and network_throttle from src/p2p to epee These even had the epee namespace. This fixes some ugly circular dependencies. --- contrib/epee/include/net/abstract_tcp_server2.h | 4 ++-- {src/p2p => contrib/epee/include/net}/connection_basic.hpp | 0 .../epee/include/net}/network_throttle-detail.hpp | 4 ++-- {src/p2p => contrib/epee/include/net}/network_throttle.hpp | 4 ++-- contrib/epee/src/CMakeLists.txt | 3 ++- {src/p2p => contrib/epee/src}/connection_basic.cpp | 4 ++-- {src/p2p => contrib/epee/src}/network_throttle-detail.cpp | 2 +- {src/p2p => contrib/epee/src}/network_throttle.cpp | 2 +- src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp | 2 +- src/cryptonote_protocol/cryptonote_protocol_handler.inl | 2 +- src/debug_utilities/object_sizes.cpp | 2 +- 11 files changed, 15 insertions(+), 14 deletions(-) rename {src/p2p => contrib/epee/include/net}/connection_basic.hpp (100%) rename {src/p2p => contrib/epee/include/net}/network_throttle-detail.hpp (98%) rename {src/p2p => contrib/epee/include/net}/network_throttle.hpp (98%) rename {src/p2p => contrib/epee/src}/connection_basic.cpp (99%) rename {src/p2p => contrib/epee/src}/network_throttle-detail.cpp (99%) rename {src/p2p => contrib/epee/src}/network_throttle.cpp (98%) diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h index 33fec8ec5..c0401c8b0 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.h +++ b/contrib/epee/include/net/abstract_tcp_server2.h @@ -54,8 +54,8 @@ #include #include "net_utils_base.h" #include "syncobj.h" -#include "../../../../src/p2p/connection_basic.hpp" -#include "../../../../src/p2p/network_throttle-detail.hpp" +#include "connection_basic.hpp" +#include "network_throttle-detail.hpp" #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "net" diff --git a/src/p2p/connection_basic.hpp b/contrib/epee/include/net/connection_basic.hpp similarity index 100% rename from src/p2p/connection_basic.hpp rename to contrib/epee/include/net/connection_basic.hpp diff --git a/src/p2p/network_throttle-detail.hpp b/contrib/epee/include/net/network_throttle-detail.hpp similarity index 98% rename from src/p2p/network_throttle-detail.hpp rename to contrib/epee/include/net/network_throttle-detail.hpp index 676d4341a..dba15a5ed 100644 --- a/src/p2p/network_throttle-detail.hpp +++ b/contrib/epee/include/net/network_throttle-detail.hpp @@ -33,8 +33,8 @@ /* rfree: throttle details, implementing rate limiting */ -#ifndef INCLUDED_src_p2p_throttle_detail_hpp -#define INCLUDED_src_p2p_throttle_detail_hpp +#ifndef INCLUDED_throttle_detail_hpp +#define INCLUDED_throttle_detail_hpp #include "network_throttle.hpp" diff --git a/src/p2p/network_throttle.hpp b/contrib/epee/include/net/network_throttle.hpp similarity index 98% rename from src/p2p/network_throttle.hpp rename to contrib/epee/include/net/network_throttle.hpp index bf1f93859..464b34726 100644 --- a/src/p2p/network_throttle.hpp +++ b/contrib/epee/include/net/network_throttle.hpp @@ -34,8 +34,8 @@ /* rfree: also includes the manager for singeton/global such objects */ -#ifndef INCLUDED_p2p_network_throttle_hpp -#define INCLUDED_p2p_network_throttle_hpp +#ifndef INCLUDED_network_throttle_hpp +#define INCLUDED_network_throttle_hpp #include #include diff --git a/contrib/epee/src/CMakeLists.txt b/contrib/epee/src/CMakeLists.txt index 5cd6d7813..b6967e8fc 100644 --- a/contrib/epee/src/CMakeLists.txt +++ b/contrib/epee/src/CMakeLists.txt @@ -26,7 +26,8 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -add_library(epee STATIC hex.cpp http_auth.cpp mlog.cpp net_utils_base.cpp string_tools.cpp wipeable_string.cpp) +add_library(epee STATIC hex.cpp http_auth.cpp mlog.cpp net_utils_base.cpp string_tools.cpp wipeable_string.cpp + connection_basic.cpp network_throttle.cpp network_throttle-detail.cpp) if (USE_READLINE AND GNU_READLINE_FOUND) add_library(epee_readline STATIC readline_buffer.cpp) endif() diff --git a/src/p2p/connection_basic.cpp b/contrib/epee/src/connection_basic.cpp similarity index 99% rename from src/p2p/connection_basic.cpp rename to contrib/epee/src/connection_basic.cpp index 06baa7893..534044a79 100644 --- a/src/p2p/connection_basic.cpp +++ b/contrib/epee/src/connection_basic.cpp @@ -32,7 +32,7 @@ /* rfree: implementation for the non-template base, can be used by connection<> template class in abstract_tcp_server2 file */ -#include "connection_basic.hpp" +#include "net/connection_basic.hpp" #include #include @@ -77,7 +77,7 @@ #include "net/abstract_tcp_server2.h" // TODO: -#include "network_throttle-detail.hpp" +#include "net/network_throttle-detail.hpp" #include "cryptonote_core/cryptonote_core.h" #undef MONERO_DEFAULT_LOG_CATEGORY diff --git a/src/p2p/network_throttle-detail.cpp b/contrib/epee/src/network_throttle-detail.cpp similarity index 99% rename from src/p2p/network_throttle-detail.cpp rename to contrib/epee/src/network_throttle-detail.cpp index 651e01e6b..317dde8e0 100644 --- a/src/p2p/network_throttle-detail.cpp +++ b/contrib/epee/src/network_throttle-detail.cpp @@ -74,7 +74,7 @@ #include "net/abstract_tcp_server2.h" // TODO: -#include "network_throttle-detail.hpp" +#include "net/network_throttle-detail.hpp" #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "net.throttle" diff --git a/src/p2p/network_throttle.cpp b/contrib/epee/src/network_throttle.cpp similarity index 98% rename from src/p2p/network_throttle.cpp rename to contrib/epee/src/network_throttle.cpp index 74b20376d..afacc3e96 100644 --- a/src/p2p/network_throttle.cpp +++ b/contrib/epee/src/network_throttle.cpp @@ -54,7 +54,7 @@ Throttling work by: // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "network_throttle-detail.hpp" +#include "net/network_throttle-detail.hpp" namespace epee { diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp index 094e4fc95..578abd20c 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp +++ b/src/cryptonote_protocol/cryptonote_protocol_handler-base.cpp @@ -70,7 +70,7 @@ #include #include "cryptonote_protocol_handler.h" -#include "p2p/network_throttle.hpp" +#include "net/network_throttle.hpp" #include "cryptonote_core/cryptonote_core.h" // e.g. for the send_stop_signal() diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl index 4ba406ffc..389e8ba84 100644 --- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl +++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl @@ -41,7 +41,7 @@ #include "cryptonote_basic/cryptonote_format_utils.h" #include "profile_tools.h" -#include "p2p/network_throttle-detail.hpp" +#include "net/network_throttle-detail.hpp" #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "net.cn" diff --git a/src/debug_utilities/object_sizes.cpp b/src/debug_utilities/object_sizes.cpp index e58da7395..82d8a4add 100644 --- a/src/debug_utilities/object_sizes.cpp +++ b/src/debug_utilities/object_sizes.cpp @@ -31,7 +31,7 @@ #include "cryptonote_basic/tx_extra.h" #include "cryptonote_core/blockchain.h" #include "p2p/p2p_protocol_defs.h" -#include "p2p/connection_basic.hpp" +#include "net/connection_basic.hpp" #include "p2p/net_peerlist.h" #include "p2p/net_node.h" #include "cryptonote_protocol/cryptonote_protocol_handler.h"