mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
Compatibility with libevent 2.2 (#7765)
* Compatibility with libevent 2.2 * Fix Android builds * Fix Win32 builds
This commit is contained in:
@@ -335,7 +335,11 @@ void handle_web_client(struct evhttp_request* req, tr_rpc_server const* server)
|
||||
{
|
||||
if (auto* const con = evhttp_request_get_connection(req); con != nullptr)
|
||||
{
|
||||
#if LIBEVENT_VERSION_NUMBER >= 0x02020001
|
||||
char const* remote_host = nullptr;
|
||||
#else
|
||||
char* remote_host = nullptr;
|
||||
#endif
|
||||
auto remote_port = ev_uint16_t{};
|
||||
evhttp_connection_get_peer(con, &remote_host, &remote_port);
|
||||
tr_logAddWarn(fmt::format(
|
||||
@@ -509,7 +513,11 @@ void handle_request(struct evhttp_request* req, void* arg)
|
||||
|
||||
auto* server = static_cast<tr_rpc_server*>(arg);
|
||||
|
||||
#if LIBEVENT_VERSION_NUMBER >= 0x02020001
|
||||
char const* remote_host = nullptr;
|
||||
#else
|
||||
char* remote_host = nullptr;
|
||||
#endif
|
||||
auto remote_port = ev_uint16_t{};
|
||||
evhttp_connection_get_peer(con, &remote_host, &remote_port);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user