diff --git a/lib/roles/http/server/server.c b/lib/roles/http/server/server.c index f855d2972..bc316d5ae 100644 --- a/lib/roles/http/server/server.c +++ b/lib/roles/http/server/server.c @@ -1562,7 +1562,6 @@ lws_http_action(struct lws *wsi) pp = lws_vhost_name_to_protocol(wsi->vhost, name); if (!pp) { - n = -1; lwsl_err("Unable to find plugin '%s'\n", hit->origin); return 1; @@ -1646,9 +1645,10 @@ lws_http_action(struct lws *wsi) #if defined(LWS_WITH_FILE_OPS) if (hit->origin_protocol == LWSMPRO_FILE) m = lws_http_serve(wsi, s, hit->origin, hit); -#endif - if (m > 0) { + if (m > 0) +#endif + { /* * lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL); */ diff --git a/lib/system/async-dns/async-dns.c b/lib/system/async-dns/async-dns.c index 7e3db09b1..93bd8708f 100644 --- a/lib/system/async-dns/async-dns.c +++ b/lib/system/async-dns/async-dns.c @@ -1,7 +1,7 @@ /* * libwebsockets - small server side websockets and web server implementation * - * Copyright (C) 2010 - 2019 Andy Green + * Copyright (C) 2010 - 2020 Andy Green * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to @@ -172,7 +172,11 @@ lws_async_dns_writeable(struct lws *wsi, lws_adns_q_t *q) /* we hack b0 of the tid to be 0 = A, 1 = AAAA */ - lws_ser_wu16be(&p[DHO_TID], which ? q->tid | 1 : q->tid); + lws_ser_wu16be(&p[DHO_TID], +#if defined(LWS_WITH_IPV6) + which ? q->tid | 1 : +#endif + q->tid); lws_ser_wu16be(&p[DHO_FLAGS], (1 << 8)); lws_ser_wu16be(&p[DHO_NQUERIES], 1); diff --git a/minimal-examples/client-server/minimal-ws-proxy/mount-origin/example.js b/minimal-examples/client-server/minimal-ws-proxy/mount-origin/example.js index cfe67a72e..e48392246 100644 --- a/minimal-examples/client-server/minimal-ws-proxy/mount-origin/example.js +++ b/minimal-examples/client-server/minimal-ws-proxy/mount-origin/example.js @@ -28,9 +28,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js b/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js index df87787c0..5168859b8 100644 --- a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js +++ b/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js @@ -210,9 +210,6 @@ function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js b/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js index 5d56ca2dc..096909f6f 100644 --- a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js +++ b/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js @@ -113,9 +113,6 @@ function lws_gray_out(vis, _options) { function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lws-common.js b/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lws-common.js index 5d56ca2dc..096909f6f 100644 --- a/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lws-common.js +++ b/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lws-common.js @@ -113,9 +113,6 @@ function lws_gray_out(vis, _options) { function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lwsgs.js b/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lwsgs.js index 5fe956232..e1204ccc4 100644 --- a/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lwsgs.js +++ b/minimal-examples/http-server/minimal-http-server-generic-sessions/mount-origin/lwsgs.js @@ -609,11 +609,8 @@ window.addEventListener("load", function() { } if (lwsgs_user) { - if (typeof MozWebSocket != "undefined") - ws = new MozWebSocket(get_appropriate_ws_url(), - "protocol-lws-messageboard"); - else - ws = new WebSocket(get_appropriate_ws_url(), + + ws = new WebSocket(get_appropriate_ws_url(), "protocol-lws-messageboard"); try { diff --git a/minimal-examples/ws-server/minimal-ws-broker/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-broker/mount-origin/example.js index e9ddedb94..67c877688 100644 --- a/minimal-examples/ws-server/minimal-ws-broker/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-broker/mount-origin/example.js @@ -27,9 +27,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js index dc4c4a941..33911b45a 100644 --- a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js @@ -27,9 +27,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js index ec3a99c31..aedf5bf74 100644 --- a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js @@ -27,9 +27,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/example.js index 0aac55e53..d10384a39 100644 --- a/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/example.js @@ -27,9 +27,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/example.js index 72007c8d7..6b2cdcea6 100644 --- a/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/example.js @@ -26,9 +26,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/example.js index 01bdd1b5e..cccc7d99a 100644 --- a/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/example.js @@ -28,9 +28,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket !== "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js index 60975fbdd..b17a826f9 100644 --- a/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js @@ -28,9 +28,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/example.js index 60975fbdd..b17a826f9 100644 --- a/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/example.js @@ -28,9 +28,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/example.js index 3a638d0ab..5cc307327 100644 --- a/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/example.js @@ -27,9 +27,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/minimal-examples/ws-server/minimal-ws-server/mount-origin/example.js b/minimal-examples/ws-server/minimal-ws-server/mount-origin/example.js index 8056d3dfa..9c0a6ab72 100644 --- a/minimal-examples/ws-server/minimal-ws-server/mount-origin/example.js +++ b/minimal-examples/ws-server/minimal-ws-server/mount-origin/example.js @@ -27,9 +27,6 @@ function get_appropriate_ws_url(extra_url) function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/plugins/deaddrop/assets/deaddrop.js b/plugins/deaddrop/assets/deaddrop.js index df87787c0..5168859b8 100644 --- a/plugins/deaddrop/assets/deaddrop.js +++ b/plugins/deaddrop/assets/deaddrop.js @@ -210,9 +210,6 @@ function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); } diff --git a/plugins/generic-sessions/assets/lwsgs.js b/plugins/generic-sessions/assets/lwsgs.js index 38dc5b107..bcfd3d14b 100644 --- a/plugins/generic-sessions/assets/lwsgs.js +++ b/plugins/generic-sessions/assets/lwsgs.js @@ -603,10 +603,6 @@ window.addEventListener("load", function() { } if (lwsgs_user) { - if (typeof MozWebSocket != "undefined") - ws = new MozWebSocket(get_appropriate_ws_url(), - "protocol-lws-messageboard"); - else ws = new WebSocket(get_appropriate_ws_url(), "protocol-lws-messageboard"); diff --git a/plugins/generic-table/assets/lwsgt.js b/plugins/generic-table/assets/lwsgt.js index dc93895d6..5e4365a23 100644 --- a/plugins/generic-table/assets/lwsgt.js +++ b/plugins/generic-table/assets/lwsgt.js @@ -67,10 +67,7 @@ function lwsgt_initial(title, pcol, divname, cb, gname) lws_gray_out(true,{"zindex":"499"}); - if (typeof MozWebSocket != "undefined") - this.lwsgt_ws = new MozWebSocket(lwsgt_get_appropriate_ws_url(), pcol); - else - this.lwsgt_ws = new WebSocket(lwsgt_get_appropriate_ws_url(), pcol); + this.lwsgt_ws = new WebSocket(lwsgt_get_appropriate_ws_url(), pcol); this.lwsgt_ws.divname = divname; this.lwsgt_ws.lwsgt_cb = cb; this.lwsgt_ws.lwsgt_parent = gname; diff --git a/test-apps/lws-common.js b/test-apps/lws-common.js index 5d56ca2dc..096909f6f 100644 --- a/test-apps/lws-common.js +++ b/test-apps/lws-common.js @@ -113,9 +113,6 @@ function lws_gray_out(vis, _options) { function new_ws(urlpath, protocol) { - if (typeof MozWebSocket != "undefined") - return new MozWebSocket(urlpath, protocol); - return new WebSocket(urlpath, protocol); }