From 091ccc38c2e589b649648cbcc99aca4802f98775 Mon Sep 17 00:00:00 2001 From: Perlover Date: Fri, 26 Nov 2021 17:27:48 +0100 Subject: The evhttp_connection_get_peer function from libevent changes the type of the second parameter. Fixing the problem. --- src/httpserver.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/httpserver.cpp') diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 6e75e28596..59569b20a4 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -2,6 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#if defined(HAVE_CONFIG_H) +#include +#endif + #include #include @@ -597,7 +601,13 @@ CService HTTPRequest::GetPeer() const // evhttp retains ownership over returned address string const char* address = ""; uint16_t port = 0; + +#if HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR + evhttp_connection_get_peer(con, &address, &port); +#else evhttp_connection_get_peer(con, (char**)&address, &port); +#endif // HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR + peer = LookupNumeric(address, port); } return peer; -- cgit v1.2.3 From c62d763fc313585d79ad833c9d729f6acf2652aa Mon Sep 17 00:00:00 2001 From: Perlover Date: Tue, 7 Dec 2021 17:02:04 +0100 Subject: Necessary improvements to make configure work without libevent installed --- src/httpserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/httpserver.cpp') diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 59569b20a4..e18828e31d 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -602,7 +602,7 @@ CService HTTPRequest::GetPeer() const const char* address = ""; uint16_t port = 0; -#if HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR +#ifdef HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR evhttp_connection_get_peer(con, &address, &port); #else evhttp_connection_get_peer(con, (char**)&address, &port); -- cgit v1.2.3