mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-04 18:36:02 -05:00
Honour IPv6 config option for HTTP services
This commit is contained in:
parent
f4d6287f17
commit
69fe64c277
12
src/httpd.c
12
src/httpd.c
@ -1200,10 +1200,13 @@ int
|
||||
httpd_init(void)
|
||||
{
|
||||
unsigned short port;
|
||||
int v6enabled;
|
||||
int ret;
|
||||
|
||||
httpd_exit = 0;
|
||||
|
||||
v6enabled = cfg_getbool(cfg_getsec(cfg, "general"), "ipv6");
|
||||
|
||||
evbase_httpd = event_base_new();
|
||||
if (!evbase_httpd)
|
||||
{
|
||||
@ -1288,9 +1291,12 @@ httpd_init(void)
|
||||
goto bind_fail;
|
||||
}
|
||||
|
||||
ret = evhttp_bind_socket(evhttpd, "::", port);
|
||||
if (ret < 0)
|
||||
DPRINTF(E_WARN, L_HTTPD, "Could not bind IN6ADDR_ANY:%d (that's OK)\n", port);
|
||||
if (v6enabled)
|
||||
{
|
||||
ret = evhttp_bind_socket(evhttpd, "::", port);
|
||||
if (ret < 0)
|
||||
DPRINTF(E_WARN, L_HTTPD, "Could not bind IN6ADDR_ANY:%d (that's OK)\n", port);
|
||||
}
|
||||
|
||||
evhttp_set_gencb(evhttpd, httpd_gen_cb, NULL);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user