mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-28 21:18:13 -05:00
[httpd/websocket/conf] Initial websocket implementation
If enabled (default) requires libwebsockets >= 2.0.2, can be disabled with configure option --disable-websocket.
This commit is contained in:
21
src/httpd.c
21
src/httpd.c
@@ -68,6 +68,10 @@
|
||||
#ifdef HAVE_SPOTIFY_H
|
||||
# include "spotify.h"
|
||||
#endif
|
||||
#ifdef WEBSOCKET
|
||||
# include "websocket.h"
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* HTTP client quirks by User-Agent, from mt-daapd
|
||||
@@ -1510,6 +1514,16 @@ httpd_init(void)
|
||||
goto jsonapi_fail;
|
||||
}
|
||||
|
||||
#ifdef WEBSOCKET
|
||||
ret = websocket_init();
|
||||
if (ret < 0)
|
||||
{
|
||||
DPRINTF(E_FATAL, L_HTTPD, "Websocket init failed\n");
|
||||
|
||||
goto websocket_fail;
|
||||
}
|
||||
#endif
|
||||
|
||||
streaming_init();
|
||||
|
||||
#ifdef HAVE_EVENTFD
|
||||
@@ -1616,6 +1630,10 @@ httpd_init(void)
|
||||
#endif
|
||||
pipe_fail:
|
||||
streaming_deinit();
|
||||
#ifdef WEBSOCKET
|
||||
websocket_deinit();
|
||||
#endif
|
||||
websocket_fail:
|
||||
jsonapi_deinit();
|
||||
jsonapi_fail:
|
||||
dacp_deinit();
|
||||
@@ -1664,6 +1682,9 @@ httpd_deinit(void)
|
||||
}
|
||||
|
||||
streaming_deinit();
|
||||
#ifdef WEBSOCKET
|
||||
websocket_deinit();
|
||||
#endif
|
||||
jsonapi_deinit();
|
||||
rsp_deinit();
|
||||
dacp_deinit();
|
||||
|
||||
Reference in New Issue
Block a user