mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 05:34:58 -05:00
Create evbase_httpd before protocol handlers init
DACP needs the httpd event base at init time.
This commit is contained in:
22
src/httpd.c
22
src/httpd.c
@@ -1087,12 +1087,20 @@ httpd_init(void)
|
|||||||
|
|
||||||
httpd_exit = 0;
|
httpd_exit = 0;
|
||||||
|
|
||||||
|
evbase_httpd = event_base_new();
|
||||||
|
if (!evbase_httpd)
|
||||||
|
{
|
||||||
|
DPRINTF(E_FATAL, L_HTTPD, "Could not create an event base\n");
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
ret = rsp_init();
|
ret = rsp_init();
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
DPRINTF(E_FATAL, L_HTTPD, "RSP protocol init failed\n");
|
DPRINTF(E_FATAL, L_HTTPD, "RSP protocol init failed\n");
|
||||||
|
|
||||||
return -1;
|
goto rsp_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = daap_init();
|
ret = daap_init();
|
||||||
@@ -1133,14 +1141,6 @@ httpd_init(void)
|
|||||||
}
|
}
|
||||||
#endif /* USE_EVENTFD */
|
#endif /* USE_EVENTFD */
|
||||||
|
|
||||||
evbase_httpd = event_base_new();
|
|
||||||
if (!evbase_httpd)
|
|
||||||
{
|
|
||||||
DPRINTF(E_FATAL, L_HTTPD, "Could not create an event base\n");
|
|
||||||
|
|
||||||
goto evbase_fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef USE_EVENTFD
|
#ifdef USE_EVENTFD
|
||||||
event_set(&exitev, exit_efd, EV_READ, exit_cb, NULL);
|
event_set(&exitev, exit_efd, EV_READ, exit_cb, NULL);
|
||||||
#else
|
#else
|
||||||
@@ -1191,8 +1191,6 @@ httpd_init(void)
|
|||||||
bind_fail:
|
bind_fail:
|
||||||
evhttp_free(evhttpd);
|
evhttp_free(evhttpd);
|
||||||
evhttp_fail:
|
evhttp_fail:
|
||||||
event_base_free(evbase_httpd);
|
|
||||||
evbase_fail:
|
|
||||||
#ifdef USE_EVENTFD
|
#ifdef USE_EVENTFD
|
||||||
close(exit_efd);
|
close(exit_efd);
|
||||||
#else
|
#else
|
||||||
@@ -1205,6 +1203,8 @@ httpd_init(void)
|
|||||||
daap_deinit();
|
daap_deinit();
|
||||||
daap_fail:
|
daap_fail:
|
||||||
rsp_deinit();
|
rsp_deinit();
|
||||||
|
rsp_fail:
|
||||||
|
event_base_free(evbase_httpd);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user