mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-26 04:49:18 -05:00
Create evbase_httpd before protocol handlers init
DACP needs the httpd event base at init time.
This commit is contained in:
parent
dc95a04562
commit
8427707afc
22
src/httpd.c
22
src/httpd.c
@ -1087,12 +1087,20 @@ httpd_init(void)
|
||||
|
||||
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();
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_FATAL, L_HTTPD, "RSP protocol init failed\n");
|
||||
|
||||
return -1;
|
||||
goto rsp_fail;
|
||||
}
|
||||
|
||||
ret = daap_init();
|
||||
@ -1133,14 +1141,6 @@ httpd_init(void)
|
||||
}
|
||||
#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
|
||||
event_set(&exitev, exit_efd, EV_READ, exit_cb, NULL);
|
||||
#else
|
||||
@ -1191,8 +1191,6 @@ httpd_init(void)
|
||||
bind_fail:
|
||||
evhttp_free(evhttpd);
|
||||
evhttp_fail:
|
||||
event_base_free(evbase_httpd);
|
||||
evbase_fail:
|
||||
#ifdef USE_EVENTFD
|
||||
close(exit_efd);
|
||||
#else
|
||||
@ -1205,6 +1203,8 @@ httpd_init(void)
|
||||
daap_deinit();
|
||||
daap_fail:
|
||||
rsp_deinit();
|
||||
rsp_fail:
|
||||
event_base_free(evbase_httpd);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user