The developers of the libevent
library changed the parameter type, which now conflicts with your parameter conversion.
Expected behavior
A compilation without errors
Actual behavior
A compilation from sources (the current master branch today) shows to me a following errors:
0 CXX libbitcoin_server_a-httpserver.o
1httpserver.cpp: In member function 'CService HTTPRequest::GetPeer() const':
2httpserver.cpp:600:41: error: invalid conversion from 'char**' to 'const char**' [-fpermissive]
3 600 | evhttp_connection_get_peer(con, (char**)&address, &port);
4 | ^~~~~~~~~~~~~~~~
5 | |
6 | char**
7In file included from ./support/events.h:12,
8 from httpserver.cpp:35:
9/home/bitcoin/include/event2/http.h:981:18: note: initializing argument 2 of 'void evhttp_connection_get_peer(evhttp_connection*, const char**, uint16_t*)'
10 981 | const char **address, ev_uint16_t *port);
11 | ~~~~~~~~~~~~~^~~~~~~
I researched the problem and found that the libevent which I use (from sources) has the related commit:
0commit a18301a2bb160ff7c3ffaf5b7653c39ffe27b385
1Author: Leon M. George <leon@georgemail.eu>
2Date: Tue Sep 8 15:38:16 2020 +0200
3
4 http: const out address param to evcon_get_peer
5
6diff --git a/http.c b/http.c
7index abd255dc..8afb3600 100644
8--- a/http.c
9+++ b/http.c
10@@ -2754,7 +2754,7 @@ evhttp_connection_set_closecb(struct evhttp_connection *evcon,
11
12 void
13 evhttp_connection_get_peer(struct evhttp_connection *evcon,
14- char **address, ev_uint16_t *port)
15+ const char **address, ev_uint16_t *port)
To reproduce
May be you have to have a following software:
- gcc v11.2.0
- libevent with commit
a18301a2bb160ff7c3ffaf5b7653c39ffe27b385
(Tue Sep 8 15:38:16 2020 +0200) - bitcoind current master branch (at 2021-11-26)
System information