[httpd] Fix evhttp_connection_get_peer() const char warning for newer libevent

This commit is contained in:
ejurgensen
2022-12-25 20:09:38 +01:00
parent b70188f4b8
commit 017e09d7c3
3 changed files with 15 additions and 1 deletions

View File

@@ -1006,7 +1006,11 @@ httpd_request_parse(struct evhttp_request *req, struct httpd_uri_parsed *uri_par
evcon = evhttp_request_get_connection(req);
if (evcon)
#ifdef HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR
evhttp_connection_get_peer(evcon, &hreq->peer_address, &hreq->peer_port);
#else
evhttp_connection_get_peer(evcon, (char **)&hreq->peer_address, &hreq->peer_port);
#endif
else
DPRINTF(E_LOG, L_HTTPD, "Connection to client lost or missing\n");

View File

@@ -52,7 +52,7 @@ struct httpd_request {
// http request struct (if available)
struct evhttp_request *req;
// Source IP address (ipv4 or ipv6) and port of the request (if available)
char *peer_address;
const char *peer_address;
unsigned short peer_port;
// A pointer to extra data that the module handling the request might need
void *extra_data;