mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
test-assets-into-usr-share.patch
Signed-off-by: Andy Green <andy@warmcat.com>
This commit is contained in:
parent
7310e9c77b
commit
3138e44826
2 changed files with 7 additions and 4 deletions
|
@ -10,5 +10,7 @@ clean:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
cp -f libwebsockets-test-server $(DESTDIR)/usr/bin
|
cp -f libwebsockets-test-server $(DESTDIR)/usr/bin
|
||||||
|
mkdir -p $(DESTDIR)/usr/share/libwebsockets-test-server
|
||||||
|
cp -f favicon.ico test.html $(DESTDIR)/usr/share/libwebsockets-test-server
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* Shows how to use libwebsocket
|
* Shows how to use libwebsocket
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define LOCAL_RESOURCE_PATH "/usr/share/libwebsockets-test-server"
|
||||||
static int port = 7681;
|
static int port = 7681;
|
||||||
static int ws_protocol = 76;
|
static int ws_protocol = 76;
|
||||||
|
|
||||||
|
@ -102,16 +103,16 @@ static int websocket_callback(struct libwebsocket * wsi,
|
||||||
|
|
||||||
uri = libwebsocket_get_uri(wsi);
|
uri = libwebsocket_get_uri(wsi);
|
||||||
if (uri && strcmp(uri, "/favicon.ico") == 0) {
|
if (uri && strcmp(uri, "/favicon.ico") == 0) {
|
||||||
if (libwebsockets_serve_http_file(wsi, "./favicon.ico",
|
if (libwebsockets_serve_http_file(wsi,
|
||||||
"image/x-icon"))
|
LOCAL_RESOURCE_PATH"/favicon.ico", "image/x-icon"))
|
||||||
fprintf(stderr, "Failed to send favicon\n");
|
fprintf(stderr, "Failed to send favicon\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* send the script... when it runs it'll start websockets */
|
/* send the script... when it runs it'll start websockets */
|
||||||
|
|
||||||
if (libwebsockets_serve_http_file(wsi, "./test.html",
|
if (libwebsockets_serve_http_file(wsi,
|
||||||
"text/html"))
|
LOCAL_RESOURCE_PATH"/test.html", "text/html"))
|
||||||
fprintf(stderr, "Failed to send HTTP file\n");
|
fprintf(stderr, "Failed to send HTTP file\n");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue