[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:
chme
2017-08-12 20:01:57 +02:00
parent 0abf195347
commit 75eb5420fd
5 changed files with 393 additions and 1 deletions

View File

@@ -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();