{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1751085275,
"reponame":"libwebsockets",
"desc":"libwebsockets lightweight C networking library",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"493c456e2ef2af328b414843e4b56c70",
"commit": {"type":"commit",
"time": 1589208013,
"time_ofs": 60,
"oid_tree": { "oid": "58730d61b5fd25a953ec5a6b7261e1ad774865ab", "alias": []},
"oid":{ "oid": "9f1d019352e5d06db436674b985da4eff9738777", "alias": []},
"msg": "CTest: migrate and deprecate existing selftest scripts",
"sig_commit": { "git_time": { "time": 1589208013, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },
"sig_author": { "git_time": { "time": 1586887453, "offset": 60 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }},
"body": "CTest: migrate and deprecate existing selftest scripts\n\nReplace the bash selftest plumbing with CTest.\n\nTo use the selftests, build with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\nand `CTEST_OUTPUT_ON_FAILURE\u003d1 make test` or just\n`make test`.\n\nTo disable tests that require internet access, also give\n-DLWS_CTEST_INTERNET_AVAILABLE\u003d0\n\nRemove travis and appveyor scripts on master.\n\nRemove travis and appveyor decals on README.md."
,
"diff": "diff --git a/.sai.json b/.sai.json\nindex 41c7a9e..294ffa3 100644\n--- a/.sai.json\n+++ b/.sai.json\n@@ -14,6 +14,9 @@\n \t\t\u0022linux-fedora-32-x86_64\u0022: {\n \t\t\t\u0022build\u0022: \u0022mkdir build destdir;cd build;export CCACHE_DISABLE\u003d1;export SAI_CPACK\u003d\u005c\u0022-G RPM\u005c\u0022;cmake .. ${cmake} \u0026\u0026 make -j \u0026\u0026 make -j DESTDIR\u003d../destdir install \u0026\u0026 ctest -j4 --output-on-failure ${cpack}\u0022\n \t\t},\n+\t\t\u0022linux-centos-8-x8664\u0022: {\n+\t\t\t\u0022build\u0022: \u0022mkdir build destdir;cd build;export CCACHE_DISABLE\u003d1;export SAI_CPACK\u003d\u005c\u0022-G RPM\u005c\u0022;cmake .. ${cmake} \u0026\u0026 make -j \u0026\u0026 make -j DESTDIR\u003d../destdir install \u0026\u0026 ctest -j4 --output-on-failure ${cpack}\u0022\n+\t\t},\n \t\t\u0022linux-debian-buster-arm32\u0022: {\n \t\t\t\u0022build\u0022: \u0022mkdir build;cd build;export CCACHE_DISABLE\u003d1;export SAI_CPACK\u003d\u005c\u0022-G DEB\u005c\u0022;cmake .. ${cmake} \u0026\u0026 make -j3 \u0026\u0026 make -j DESTDIR\u003d../destdir install \u0026\u0026 ctest -j3 --output-on-failure ${cpack}\u0022,\n \t\t\t\u0022default\u0022: false\n@@ -44,20 +47,34 @@\n \t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dRELEASE -DLWS_WITH_GENCRYPTO\u003d1 -DLWS_WITH_JOSE\u003d1 -DLWS_WITH_SYS_ASYNC_DNS\u003d1 -DLWS_WITH_SYS_NTPCLIENT\u003d1\u0022,\n \t\t\t\u0022platforms\u0022:\t\u0022windows-10\u0022\n \t\t},\n+\t\t\u0022secure-streams\u0022: {\n+\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_SECURE_STREAMS\u003d1\u0022,\n+\t\t\t\u0022platforms\u0022:\t\u0022windows-10\u0022\n+\t\t},\n+\t\t\u0022secure-streams-proxy\u0022: {\n+\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_SECURE_STREAMS\u003d1 -DLWS_WITH_SECURE_STREAMS_PROXY_API\u003d1\u0022,\n+\t\t\t\u0022platforms\u0022:\t\u0022not windows-10\u0022\n+\t\t},\n \t\t\u0022distro_recommended\u0022: {\n \t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_DISTRO_RECOMMENDED\u003d1\u0022,\n \t\t\t\u0022platforms\u0022:\t\u0022not linkit-cross, not windows-10, linux-debian-buster-arm32\u0022,\n \t\t\t\u0022cpack\u0022:\t\u0022\u0026\u0026 cpack $SAI_CPACK\u0022,\n-\t\t\t\u0022artifacts\u0022:\t\u0022build/*.rpm, build/*.deb\u0022\n+\t\t\t\u0022artifacts\u0022:\t\u0022build/*.rpm, build/*.deb, build/*.zip\u0022\n \t\t},\n \t\t\u0022lwsws\u0022: {\n-\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_WITH_GENCRYPTO\u003d1 -DLWS_WITH_JOSE\u003d1 -DLWS_WITH_SYS_ASYNC_DNS\u003d1 -DLWS_WITH_SYS_NTPCLIENT\u003d1\u0022\n+\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_WITH_GENCRYPTO\u003d1 -DLWS_WITH_JOSE\u003d1 -DLWS_WITH_SYS_ASYNC_DNS\u003d1 -DLWS_WITH_SYS_NTPCLIENT\u003d1\u0022,\n+\t\t\t# no distro -devel package for libuv\n+\t\t\t\u0022platforms\u0022:\t\u0022not linux-centos-8-x8664\u0022\n \t\t},\n \t\t\u0022lwsws2\u0022: {\n-\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_WITH_LWS_DSH\u003d1\u0022\n+\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_WITH_LWS_DSH\u003d1\u0022,\n+\t\t\t# no distro -devel package for libuv\n+\t\t\t\u0022platforms\u0022:\t\u0022not linux-centos-8-x8664\u0022\n \t\t},\n \t\t\u0022mbedtls\u0022: {\n-\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_MBEDTLS\u003d1 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_LWSWS\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DLWS_WITH_JOSE\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG\u0022\n+\t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITH_MBEDTLS\u003d1 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_LWSWS\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DLWS_WITH_JOSE\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG\u0022,\n+\t\t\t# no distro -devel package for mbedtls\n+\t\t\t\u0022platforms\u0022:\t\u0022not linux-centos-8-x8664\u0022\n \t\t},\n \t\t\u0022noserver\u0022: {\n \t\t\t\u0022cmake\u0022:\t\u0022-DLWS_WITHOUT_SERVER\u003dON -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\ndiff --git a/.travis.yml b/.travis.yml\ndeleted file mode 100644\nindex b0b9f59..0000000\n--- a/.travis.yml\n+++ /dev/null\n@@ -1,54 +0,0 @@\n-env:\n- # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created\n- # via the \u0022travis encrypt\u0022 command using the project repo's public key\n- global:\n- - secure: \u0022KhAdQ9ja+LBObWNQTYO7Df5J4DyOih6S+eerDMu8UPSO+CoWV2pWoQzbOfocjyOscGOwC+2PrrHDNZyGfqkCLDXg1BxynXPCFerHC1yc2IajvKpGXmAAygNIvp4KACDfGv/dkXrViqIzr/CdcNaU4vIMHSVb5xkeLi0W1dPnQOI\u003d\u0022\n- matrix:\n- # 2019-09-30: travis build no longer has dbus\n- # LWS_METHOD\u003dlwsws CMAKE_ARGS\u003d\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_ROLE_DBUS\u003d1 -DLWS_DBUS_INCLUDE2\u003d/usr/lib/x86_64-linux-gnu/dbus-1.0/include/ -DLWS_WITH_GENCRYPTO\u003d1 -DLWS_WITH_JOSE\u003d1 -DLWS_WITH_SYS_ASYNC_DNS\u003d1\u0022\n- # LWS_METHOD\u003dlwsws2 CMAKE_ARGS\u003d\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_ROLE_DBUS\u003d1 -DLWS_DBUS_INCLUDE2\u003d/usr/lib/x86_64-linux-gnu/dbus-1.0/include/ -DLWS_WITH_LWS_DSH\u003d1\u0022\n- - LWS_METHOD\u003dlwsws CMAKE_ARGS\u003d\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_WITH_GENCRYPTO\u003d1 -DLWS_WITH_JOSE\u003d1 -DLWS_WITH_SYS_ASYNC_DNS\u003d1 -DLWS_WITH_SYS_NTPCLIENT\u003d1\u0022\n- - LWS_METHOD\u003dlwsws2 CMAKE_ARGS\u003d\u0022-DLWS_WITH_LWSWS\u003dON -DLWS_WITHOUT_EXTENSIONS\u003d0 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_ACME\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG -DLWS_WITH_LWS_DSH\u003d1\u0022\n- - LWS_METHOD\u003ddefault CMAKE_ARGS\u003d\u0022-DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n- - LWS_METHOD\u003dmbedtls CMAKE_ARGS\u003d\u0022-DLWS_WITH_MBEDTLS\u003d1 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_LWSWS\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 -DLWS_WITH_JOSE\u003d1 -DCMAKE_BUILD_TYPE\u003dDEBUG\u0022\n- - LWS_METHOD\u003dss CMAKE_ARGS\u003d\u0022-DLWS_WITH_SECURE_STREAMS\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n- - LWS_METHOD\u003dss+mbedtls CMAKE_ARGS\u003d\u0022-DLWS_WITH_MBEDTLS\u003d1 -DLWS_WITH_SECURE_STREAMS\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n- - LWS_METHOD\u003dnoserver CMAKE_ARGS\u003d\u0022-DLWS_WITHOUT_SERVER\u003dON -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n- - LWS_METHOD\u003dnoclient CMAKE_ARGS\u003d\u0022-DLWS_WITHOUT_CLIENT\u003dON -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n- - LWS_METHOD\u003dnoext CMAKE_ARGS\u003d\u0022-DLWS_WITHOUT_EXTENSIONS\u003dON -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n- - LWS_METHOD\u003dnonetwork CMAKE_ARGS\u003d\u0022-DLWS_WITH_NETWORK\u003d0\u0022\n- - LWS_METHOD\u003dlibev CMAKE_ARGS\u003d\u0022-DLWS_WITH_LIBEV\u003dON\u0022\n- - LWS_METHOD\u003dipv6 CMAKE_ARGS\u003d\u0022-DLWS_IPV6\u003dON\u0022\n- - LWS_METHOD\u003dnossl CMAKE_ARGS\u003d\u0022-DLWS_WITH_SSL\u003dOFF\u0022\n- - LWS_METHOD\u003dnodaemon CMAKE_ARGS\u003d\u0022-DLWS_WITHOUT_DAEMONIZE\u003dON\u0022\n- - LWS_METHOD\u003dcgi CMAKE_ARGS\u003d\u0022-DLWS_WITH_CGI\u003dON\u0022\n- - LWS_METHOD\u003dnologs CMAKE_ARGS\u003d\u0022-DLWS_WITH_NO_LOGS\u003dON\u0022\n- - LWS_METHOD\u003dsmp CMAKE_ARGS\u003d\u0022-DLWS_MAX_SMP\u003d32 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n- - LWS_METHOD\u003dnows CMAKE_ARGS\u003d\u0022-DLWS_ROLE_WS\u003d0\u0022\n- - LWS_METHOD\u003dmqtt CMAKE_ARGS\u003d\u0022-DLWS_ROLE_MQTT\u003d1\u0022\n- - LWS_METHOD\u003dthreadpool CMAKE_ARGS\u003d\u0022-DLWS_WITH_THREADPOOL\u003d1 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\u0022\n-\n-os:\n- - linux\n- - osx\n-language: generic\n-install:\n- - ./scripts/travis_install.sh\n-# - ./travis-tool.sh github_package jimhester/covr\n-\n-#after_success:\n-# - Rscript -e 'covr::coveralls()'\n-\n-script:\n- - ./scripts/travis_control.sh\n-sudo: required\n-dist: trusty\n-addons:\n- coverity_scan:\n- project:\n- name: \u0022warmcat/libwebsockets\u0022\n- notification_email: andy@warmcat.com\n- build_command_prepend: \u0022mkdir build \u0026\u0026 cd build \u0026\u0026 cmake ..\u0022\n- build_command: \u0022cmake --build .\u0022\n- branch_pattern: coverity_scan\n-\ndiff --git a/CMakeLists.txt b/CMakeLists.txt\nindex 72bbe67..5d5abe3 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -272,7 +272,8 @@ if(LWS_WITH_DISTRO_RECOMMENDED)\n \tset(LWS_WITH_STRUCT_JSON 1)\n \tset(LWS_WITH_STRUCT_SQLITE3 1)\n \tset(LWS_WITH_SPAWN 1)\n-\tset(LWS_WITH_FSMOUNT 1)\n+# libmount is problematic on Centos 8 / RHEL 8\n+#\tset(LWS_WITH_FSMOUNT 1)\n \tset(LWS_ROLE_MQTT 1)\n \tset(LWS_WITH_SECURE_STREAMS 1)\n \tset(LWS_WITH_SECURE_STREAMS_PROXY_API 1)\ndiff --git a/README.md b/README.md\nindex ce2e139..8e1e7c4 100644\n--- a/README.md\n+++ b/README.md\n@@ -1,4 +1,4 @@\n-[](https://travis-ci.org/warmcat/libwebsockets) [](https://ci.appveyor.com/project/lws-team/libwebsockets) [](https://scan.coverity.com/projects/3576) [](https://bestpractices.coreinfrastructure.org/projects/2266) [](https://www.codacy.com/app/lws-team/libwebsockets?utm_source\u003dgithub.com\u0026amp;utm_medium\u003dreferral\u0026amp;utm_content\u003dwarmcat/libwebsockets\u0026amp;utm_campaign\u003dBadge_Grade) [](https://lgtm.com/projects/g/warmcat/libwebsockets/alerts/) [](https://lgtm.com/projects/g/warmcat/libwebsockets/context:cpp) [](https://lgtm.com/projects/g/warmcat/libwebsockets/context:javascript)\n+[](https://libwebsockets.org/git/libwebsockets) [](https://scan.coverity.com/projects/3576) [](https://bestpractices.coreinfrastructure.org/projects/2266) [](https://www.codacy.com/app/lws-team/libwebsockets?utm_source\u003dgithub.com\u0026amp;utm_medium\u003dreferral\u0026amp;utm_content\u003dwarmcat/libwebsockets\u0026amp;utm_campaign\u003dBadge_Grade) [](https://lgtm.com/projects/g/warmcat/libwebsockets/alerts/) [](https://lgtm.com/projects/g/warmcat/libwebsockets/context:cpp) [](https://lgtm.com/projects/g/warmcat/libwebsockets/context:javascript)\n \n # Libwebsockets\n \ndiff --git a/READMEs/README.build-windows.md b/READMEs/README.build-windows.md\nindex 7b85369..e9d7a23 100644\n--- a/READMEs/README.build-windows.md\n+++ b/READMEs/README.build-windows.md\n@@ -1,28 +1,47 @@\n # Some notes for the windows jungle\n \n-This was how I compiled libwebsockets in windows March 2020.\n+This was how I compiled libwebsockets starting from a blank windows install\n+in March - April 2020. Doing this on a linux distro is way simpler and quicker\n+than all this!\n \n-## OpenSSL\n+## Notes on vm installation\n \n-### Installing prebuilt libs\n+### Disk size\n \n-I used the 1.1.1d (the latest) libs from here, as recommended on the OpenSSL site\n+For building you'll need 40GB+ available for the guest storage.\n \n-[overbyte.eu](https:..wiki.overbyte.eu/wiki/index.php/ICS_Download#Download_OpenSSL_Binaries_.28required_for_SSL-enabled_components.29)\n+### Required: Windows product key\n \n-I had to use procmon64 (windows' strace) to establish that these libraries are\n-looking for a cert bundle at \u0022C:\u005cProgram Files\u005cCommon Files\u005cSSL\u005ccert.pem\u0022... it's not\n-included in the zip file from the above, so...\n+Assuming like me the first thing you do with a new laptop is install Linux over\n+the windows it came with, you can recover your 'windows tax' windows product key\n+from your device typically using `sudo strings /sys/firmware/acpi/tables/MSDM`,\n+and use that for your VM install.\n \n-### Installing a cert bundle\n+### Required: Spice guest \n \n-You can get a trusted cert bundle from here\n+To have shared clipboard, and for windows video driver to match your vm window\n+resolution, you must install spice guest tools inside the windows VM. It also\n+installs some virtio pieces you will want.\n \n-[drwetter/testssl cert bundle](https://raw.githubusercontent.com/drwetter/testssl.sh/3.1dev/etc/Microsoft.pem)\n+https://www.spice-space.org/download/windows/spice-guest-tools/spice-guest-tools-latest.exe\n \n-Save it into `C:\u005cProgram Files\u005cCommon Files\u005cSSL\u005ccert.pem` where openssl will be able to see it.\n+### Blood-pressure reduction: Firefox\n+\n+https://www.mozilla.org/en-US/exp/firefox/\n+\n+When it's up, add-ons: ublock origin, privacy badger, noscript, disable search\n+bar prediction\n \n-### Installing cmake\n+### Blood-pressure reduction: Clink\n+\n+This is a hack on cmd.exe that lets it understand Ctrl-R and fixup unix-style\n+slashes automagically.\n+\n+https://github.com/mridgers/clink/releases/download/0.4.9/clink_0.4.9_setup.exe\n+\n+If you're usually using *nix, you definitely need this to keep your sanity.\n+\n+### Required: cmake\n \n CMake have a windows installer thing downloadable from here\n \n@@ -30,51 +49,113 @@ CMake have a windows installer thing downloadable from here\n \n after that you can use `cmake` from the terminal OK.\n \n-### Installing git\n+### Required: git\n \n Visit the canonical git site to download their windows installer thing\n \n [git](https://git-scm.com/download/win)\n \n-after that `git` from the terminal is working.\n+**Select the install option for \u0022extra unix commands\u0022** so you can get `ls -l`,\n+`cp`, `mv` and suchlike working in cmd.exe... that's awesome, thanks git!\n+\n+Afterwards you can just use `git` as normal from cmd.exe as well.\n \n-### Install the free \u0022community\u0022 visual studio\n+### Required: Install the \u0022free\u0022 \u0022community\u0022 visual studio\n \n You can do this through \u0022windows store\u0022 by searching for \u0022visual studio\u0022\n \n-I installed as little as possible, we just want the C \u0022C++\u0022 tools.\n+I installed as little as possible, we just want the C \u0022C++\u0022 tools... 7GB :-)\n \n It still wouldn't link without the \u0022mt\u0022 helper tool from the\n huge windows SDK, so you have to install GB of that as well.\n \n-### Building\n+They don't mention it during the install, but after 30 days this \u0022free\u0022\n+\u0022community\u0022 edition demands you open a microsoft account or it stops working.\n+In the install they give you the option to add a microsoft account and the\n+alternative is, \u0022not now, maybe later\u0022. Compare and contrast to gcc or git or\n+the other FOSS projects.\n \n-Somehow windows cmake seems slightly broken, some of the plugins and\n-examples are conditional on `if (NOT WIN32)`, but it configures them\n-anyway. For this reason (it seems \u0022only\u0022, it worked when I commented the\n-cmake entries for the related plugins) `-DLWS_WITH_MINIMAL_EXAMPLES\u003d1`\n+### Required: OpenSSL\n \n-Instead I followed how appveyor builds the stuff in CI... clone libwebsockets then\n+Ugh... I tried using prebuilts but it's unreliable and needs an unfeasible\n+amount of trust. So I recommend bite the bullet and build your own... that's\n+trivial on Linux but of course windows makes everything nasty.\n+\n+At least hopefully all the \u0022research\u0022 is done and listed out here.\n+\n+#### OpenSSL build Prerequisite: install perl binary\n+\n+Move the git version of perl out of the way, it won't work for OpenSSL build\n \n ```\n-\u003e git clone https://libwebsockets.org/repo/libwebsockets\n-\u003e cd libwebsockets\n-\u003e mkdir build\n-\u003e cd build\n-\u003e cmake ..\n-\u003e cmake --build . --config DEBUG\n+mv /usr/bin/perl /usr/bin/perl-git\n ```\n \n-Installing requires admin privs, I opened a second cmd window as admin and did it\n-there.\n+For windows, OpenSSL \u0022recommends\u0022 ActiveState perl but it doesn't work for me,\n+complaining about stuff needed from cpan and then dying when it was installed.\n+\u0022Strawberry Perl\u0022 is installed in `C:\u005cStrawberry` and worked out the box.\n+\n+http://strawberryperl.com/download/5.30.2.1/strawberry-perl-5.30.2.1-64bit.msi\n+\n+The installer sets up `%PATH%` if you open a new cmd window. \n+\n+#### OpenSSL build Prerequisite: NASM\n+\n+Go here and click on the latest stable, download the win32 .exe\n+\n+https://nasm.us/\n+\n+Just install via the defaults. Then add it to the PATH temporarily...\n \n ```\n-\u003e cmake --install . --config DEBUG\n+$ set PATH\u003d%PATH%;C:\u005cProgram Files (x86)\u005cNASM\n+```\n+\n+#### OpenSSL build setup: source VC env vars\n+\n+These fix up the PATH and include dirs etc necessary for VC build in the cmd\n+window.\n+\n+```\n+$ call \u0022C:\u005cProgram Files (x86)\u005cMicrosoft Visual Studio\u005c2019\u005cCommunity\u005cVC\u005cAuxiliary\u005cBuild\u005cvcvarsall.bat\u0022 x86_amd64\n+```\n+\n+### OpenSSL build:\n+\n+Grab openssl from git... assuming the prerequisites above went well it will\n+just sit there building for 30 minutes or whatever.\n+\n+```\n+$ git clone https://github.com/openssl/openssl\n+$ cd openssl\n+$ perl Configure VC-WIN64A\n+$ nmake\n ```\n \n-After that you can run the test apps OK.\n+Afterwards, open an Administrator mode cmd.exe, redo the msvc path and then\n+install the build.\n \n-## pthreads\n+```\n+$ cd openssl\n+$ call \u0022C:\u005cProgram Files (x86)\u005cMicrosoft Visual Studio\u005c2019\u005cCommunity\u005cVC\u005cAuxiliary\u005cBuild\u005cvcvarsall.bat\u0022 x86_amd64\n+$ nmake install\n+```\n+\n+Oh another grindingly slow windows build action. Finally it's in there in\n+`C:\u005cProgram Files\u005cOpenSSL`.\n+\n+libraries are looking for a cert bundle at \u0022C:\u005cProgram Files\u005cCommon Files\u005cSSL\u005ccert.pem\u0022...\n+it's not documented or included in the zip file from the above, so...\n+\n+#### Installing a cert bundle\n+\n+You can get a trusted cert bundle from here\n+\n+[drwetter/testssl cert bundle](https://raw.githubusercontent.com/drwetter/testssl.sh/3.1dev/etc/Microsoft.pem)\n+\n+Save it into `C:\u005cProgram Files\u005cCommon Files\u005cSSL\u005ccert.pem` where openssl will be able to see it.\n+\n+## Required: pthreads\n \n It's amazing but after all these years windows doesn't offer pthreads compatibility\n itself. Just like the many other missing POSIX bits like fork().\n@@ -89,6 +170,45 @@ Then I created a dir \u0022C:\u005cProgram Files (x86)\u005cpthreads\u0022, and copied the `dll`,\n The cmake incantation to build against pthreads set up like that is\n \n ```\n- $ cmake .. -DLWS_EXT_PTHREAD_INCLUDE_DIR\u003d\u0022C:\u005cProgram Files (x86)\u005cpthreads\u005cinclude\u0022 -DLWS_EXT_PTHREAD_LIBRARIES\u003d\u0022C:\u005cProgram Files (x86)\u005cpthreads\u005clib\u005cx64\u005clibpthreadGC2.a\u0022 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n+ $ cmake .. -DLWS_HAVE_PTHREAD_H\u003d1 -DLWS_EXT_PTHREAD_INCLUDE_DIR\u003d\u0022C:\u005cProgram Files (x86)\u005cpthreads\u005cinclude\u0022 -DLWS_EXT_PTHREAD_LIBRARIES\u003d\u0022C:\u005cProgram Files (x86)\u005cpthreads\u005clib\u005cx64\u005clibpthreadGC2.a\u0022 -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n ```\n \n+## Building libwebsockets\n+\n+We'll clone libwebsockets then use cmake to build via vs tools\n+\n+```\n+\u003e git clone https://libwebsockets.org/repo/libwebsockets\n+\u003e cd libwebsockets\n+\u003e mkdir build\n+\u003e cd build\n+\u003e cmake ..\n+\u003e cmake --build . --config DEBUG\n+```\n+\n+Installing requires admin privs, I opened a second cmd window as admin and did it\n+there.\n+\n+```\n+\u003e cmake --install . --config DEBUG\n+```\n+\n+### Hack the libs into view\n+\n+The libs we built against aren't visible in the system, I don't know what\n+Real Windows Programmers are supposed to do about that, but I used an Admin cmd\n+prompt to copy them into C:\u005cwindows\u005csystem32\n+\n+```\n+$ cp \u0022C:\u005cProgram Files (x86)\u005cpthreads\u005cdll\u005cx64\u005cpthreadGC2.dll\u0022 \u0022C:\u005cProgram Files\u005cOpenSSL\u005cbin\u005clibcrypto-3.dll\u0022 \u0022C:\u005cProgram Files\u005cOpenSSL\u005cbin\u005clibssl-3.dll\u0022 C:\u005cWindows\u005csystem32\n+```\n+\n+After that you can run the test apps OK, eg\n+\n+```\n+$ libwebsockets-test-server.exe -s\n+```\n+\n+## Note about using paths with spaces in with cmake\n+\n+\ndiff --git a/READMEs/README.ctest.md b/READMEs/README.ctest.md\nnew file mode 100644\nindex 0000000..142f33f\n--- /dev/null\n+++ b/READMEs/README.ctest.md\n@@ -0,0 +1,66 @@\n+## Using CTest with lws\n+\n+### Prerequisites\n+\n+You need a recent cmake to have the CTest tests work properly, if you're on an\n+older distro you need to update your cmake. Luckily Kitware provide a repo for\n+common distros. These instructions work for bionic and xenial.\n+\n+First remove the old distro cmake and install the pieces needed to get the new repo keys\n+\n+```\n+# apt purge --auto-remove cmake\n+# apt install gnupg wget apt-transport-https ca-certificates\n+# wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2\u003e/dev/null | sudo apt-key add -\n+# apt edit-sources\n+```\n+\n+Add the line `deb https://apt.kitware.com/ubuntu/ bionic main` at the end\n+replacing `bionic` with `xenial` as needed, and save (:wq). Then\n+\n+```\n+# apt update\n+# apt install cmake\n+```\n+\n+## Generating the tests\n+\n+The main tests just need `-DLWS_WITH_MINIMAL_EXAMPLES\u003d1`. You can optionally set\n+`-DLWS_CTEST_INTERNET_AVAILABLE\u003d0` to indicate you can't run the tests that need\n+internet connectivity.\n+\n+## Running the tests\n+\n+CMake puts the test action into a build-host type specific form, for unix type\n+platforms you just run `make test` or `CTEST_OUTPUT_ON_FAILURE\u003d1 make test` to\n+see what happened to any broken tests.\n+\n+On windows, it looks like `ctest . -C DEBUG` or RELEASE if that was the build\n+type.\n+\n+## Considerations for creating tests\n+\n+### Timeout\n+\n+The default test timeout is 1500s, for that reason it's good practice to set\n+a more suitable `TIMEOUT` property on every test.\n+\n+### Working Directory\n+\n+Server-side test apps usually need to be run from their `./minimal-examples/...`\n+directory so they can access their assets like index.html etc.\n+\n+However when building with `-DLWS_WITH_MBEDTLS\u003d1` then even client-side apps\n+need to be run from their directory, since they need to get the trusted CA for\n+warmcat.com or libwebsockets.org additionally.\n+\n+For that reason it's good practice to set the `WORKING_DIRECTORY` property to\n+the home dir of the example app in all cases.\n+\n+### SIGTERM from CTest...\n+\n+After a lot of headscratching I realized some tests were failing simply because\n+CTest was firing SIGTERMs at them for whatever reason. I added a commandline\n+option `--ignore-sigterm` in `lws_cmdline_option_handle_builtin()` to allow the\n+test to defeat this, and then it continues and completes fine.\n+\ndiff --git a/appveyor.yml b/appveyor.yml\ndeleted file mode 100644\nindex 809ff62..0000000\n--- a/appveyor.yml\n+++ /dev/null\n@@ -1,77 +0,0 @@\n-environment:\n- matrix:\n- - LWS_METHOD: jose\n- CMAKE_ARGS: -DLWS_WITH_JOSE\u003d1\n-\n- - LWS_METHOD: x64\n- CMAKE_ARGS: -DCMAKE_GENERATOR_PLATFORM\u003dx64 -DLWS_WITH_HTTP2\u003d1 -DLWS_WITH_PLUGINS\u003d1 -DLIBUV_INCLUDE_DIRS\u003dC:\u005cassets\u005clibuv64\u005cinclude -DLIBUV_LIBRARIES\u003dC:\u005cassets\u005clibuv64\u005clibuv.lib\n-\n- - LWS_METHOD: lwsws\n- CMAKE_ARGS: -DLWS_WITH_LWSWS\u003d1 -DSQLITE3_INCLUDE_DIRS\u003dC:\u005cassets\u005csqlite3 -DSQLITE3_LIBRARIES\u003dC:\u005cassets\u005csqlite3\u005csqlite3.lib -DLIBUV_INCLUDE_DIRS\u003dC:\u005cassets\u005clibuv\u005cinclude -DLIBUV_LIBRARIES\u003dC:\u005cassets\u005clibuv\u005clibuv.lib\n-\n- - LWS_METHOD: default\n-\n- - LWS_METHOD: noserver\n- CMAKE_ARGS: -DLWS_WITHOUT_SERVER\u003dON\n-\n- - LWS_METHOD: noclient\n- CMAKE_ARGS: -DLWS_WITHOUT_CLIENT\u003dON\n-\n- - LWS_METHOD: noext\n- CMAKE_ARGS: -DLWS_WITHOUT_EXTENSIONS\u003dON\n-\n- - LWS_METHOD: nossl\n- CMAKE_ARGS: -DLWS_WITH_SSL\u003dOFF\n-\n-install:\n- - appveyor DownloadFile https://libwebsockets.org:444/win-libuv.zip\n- - mkdir c:\u005cassets\n- - mkdir c:\u005cassets\u005clibuv\n- - 7z x -oc:\u005cassets\u005clibuv win-libuv.zip\n- - appveyor DownloadFile https://libwebsockets.org:444/win-libuv64.zip\n- - mkdir c:\u005cassets\u005clibuv64\n- - 7z x -oc:\u005cassets\u005clibuv64 win-libuv64.zip\n- - appveyor DownloadFile https://libwebsockets.org:444/nsis-3.0rc1-setup.exe\n- - cmd /c start /wait nsis-3.0rc1-setup.exe /S /D\u003dC:\u005cnsis\n- - appveyor DownloadFile https://libwebsockets.org:444/sqlite-dll-win32-x86-3130000.zip\n- - mkdir c:\u005cassets\u005csqlite3\n- - 7z x -oc:\u005cassets\u005csqlite3 sqlite-dll-win32-x86-3130000.zip\n- - SET PATH\u003dC:\u005cProgram Files\u005cNSIS\u005c;C:\u005cProgram Files (x86)\u005cNSIS\u005c;c:\u005cnsis;%PATH%\n-\n-build_script:\n- - md build\n- - cd build\n- - cmake -DCMAKE_BUILD_TYPE\u003dRelease %CMAKE_ARGS% ..\n- - cmake --build . --config Release\n-\n-after_build:\n- - cd %APPVEYOR_BUILD_FOLDER%\n- - mkdir staging\n- - mkdir staging\u005cinclude\n- - cp -r %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005cbin %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005clib staging\n- - if EXIST staging\u005cbin\u005cshare mv staging\u005cbin\u005cshare staging\n- - if NOT EXIST staging\u005cshare\u005clibwebsockets-test-server mkdir staging\u005cshare\u005clibwebsockets-test-server\n- - IF EXIST %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005clibwebsockets-test-server.pem cp %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005clibwebsockets-test-server.pem staging\u005cshare\u005clibwebsockets-test-server\n- - IF EXIST %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005clibwebsockets-test-server.key.pem cp %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005clibwebsockets-test-server.key.pem staging\u005cshare\u005clibwebsockets-test-server\n- - IF EXIST %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005clws_config.h cp %APPVEYOR_BUILD_FOLDER%\u005cbuild\u005clws_config.h staging\u005cinclude\n- - cp %APPVEYOR_BUILD_FOLDER%\u005cinclude\u005clibwebsockets.h staging\u005cinclude\n- - cp -r %APPVEYOR_BUILD_FOLDER%\u005cinclude\u005clibwebsockets staging\u005cinclude\n- - 7z a build\u005clws-%LWS_METHOD%-%APPVEYOR_BUILD_ID%.zip %APPVEYOR_BUILD_FOLDER%\u005cstaging\u005c*\n-\n-artifacts:\n- - path: build\u005clws-%LWS_METHOD%-%APPVEYOR_BUILD_ID%.zip\n-\n-#deploy:\n-#- provider: BinTray\n-# username: lws-team\n-# api_key:\n-# secure: nDpZ7P/wrk98DwJPMC6KpCC23QrVP8f3RxvKzBaqOmb9LiVrg1IyO1cc5vcgShZC\n-# subject: lws-team\n-# repo: libwebsockets\n-# package: windows\n-# publish: true\n-# override: true\n-# explode: false\n-\n-matrix:\n- fast_finish: true\ndiff --git a/lib/core-net/close.c b/lib/core-net/close.c\nindex 93969b3..ad6e999 100644\n--- a/lib/core-net/close.c\n+++ b/lib/core-net/close.c\n@@ -144,6 +144,7 @@ __lws_free_wsi(struct lws *wsi)\n \t\treturn;\n \n \t__lws_reset_wsi(wsi);\n+\t__lws_wsi_remove_from_sul(wsi);\n \n \tif (wsi-\u003econtext-\u003eevent_loop_ops-\u003edestroy_wsi)\n \t\twsi-\u003econtext-\u003eevent_loop_ops-\u003edestroy_wsi(wsi);\n@@ -271,7 +272,7 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason,\n \t\twsi2 \u003d wsi-\u003echild_list;\n \t\twhile (wsi2) {\n \t\t\twsi1 \u003d wsi2-\u003esibling_list;\n-\t\t\twsi2-\u003eparent \u003d NULL;\n+//\t\t\twsi2-\u003eparent \u003d NULL;\n \t\t\t/* stop it doing shutdown processing */\n \t\t\twsi2-\u003esocket_is_permanently_unusable \u003d 1;\n \t\t\t__lws_close_free_wsi(wsi2, reason,\n@@ -306,7 +307,7 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason,\n \t\t\t\tlws_cgi_remove_and_kill(wsi-\u003eparent);\n \n \t\t\t/* end the binding between us and master */\n-\t\t\tif (wsi-\u003eparent-\u003ehttp.cgi)\n+\t\t\tif (wsi-\u003eparent-\u003ehttp.cgi \u0026\u0026 wsi-\u003eparent-\u003ehttp.cgi-\u003elsp)\n \t\t\t\twsi-\u003eparent-\u003ehttp.cgi-\u003elsp-\u003estdwsi[(int)wsi-\u003elsp_channel] \u003d\n \t\t\t\t\t\t\t\t\tNULL;\n \t\t}\n@@ -454,7 +455,7 @@ just_kill_connection:\n \t !wsi-\u003ealready_did_cce \u0026\u0026 wsi-\u003eprotocol) {\n \t\tstatic const char _reason[] \u003d \u0022closed before established\u0022;\n \n-\t\tlwsl_notice(\u0022%s: closing in unestablished state 0x%x\u005cn\u0022,\n+\t\tlwsl_debug(\u0022%s: closing in unestablished state 0x%x\u005cn\u0022,\n \t\t\t\t__func__, lwsi_state(wsi));\n \t\twsi-\u003esocket_is_permanently_unusable \u003d 1;\n \ndiff --git a/lib/core-net/dummy-callback.c b/lib/core-net/dummy-callback.c\nindex 2089ffc..bfbb6c3 100644\n--- a/lib/core-net/dummy-callback.c\n+++ b/lib/core-net/dummy-callback.c\n@@ -125,7 +125,7 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,\n \n \tcase LWS_CALLBACK_CLIENT_CONNECTION_ERROR:\n \tcase LWS_CALLBACK_CLIENT_CLOSED:\n-\t\tlwsl_user(\u0022%s: client closed: parent %p\u005cn\u0022, __func__, wsi-\u003eparent);\n+\t\tlwsl_info(\u0022%s: client closed: parent %p\u005cn\u0022, __func__, wsi-\u003eparent);\n \t\tif (wsi-\u003eparent)\n lws_set_timeout(wsi-\u003eparent, 1, LWS_TO_KILL_ASYNC);\n \t\tbreak;\n@@ -193,7 +193,7 @@ lws_callback_ws_proxy(struct lws *wsi, enum lws_callback_reasons reason,\n \t\treturn 1;\n \n \tcase LWS_CALLBACK_CLOSED:\n-\t\tlwsl_user(\u0022%s: closed\u005cn\u0022, __func__);\n+\t\tlwsl_info(\u0022%s: closed\u005cn\u0022, __func__);\n \t\treturn -1;\n \n \tcase LWS_CALLBACK_RECEIVE:\ndiff --git a/lib/core-net/pollfd.c b/lib/core-net/pollfd.c\nindex ff87368..f27c404 100644\n--- a/lib/core-net/pollfd.c\n+++ b/lib/core-net/pollfd.c\n@@ -417,7 +417,7 @@ __remove_wsi_socket_from_fds(struct lws *wsi)\n \t\t\t\tlwsl_err(\u0022no wsi for fd %d pos %d, \u0022\n \t\t\t\t\t \u0022pt-\u003efds_count\u003d%d\u005cn\u0022,\n \t\t\t\t\t (int)pt-\u003efds[m].fd, m, pt-\u003efds_count);\n-\t\t\t\tassert(0);\n+\t\t\t\t// assert(0);\n \t\t\t} else\n \t\t\t\tend_wsi-\u003eposition_in_fds_table \u003d m;\n \t\t}\ndiff --git a/lib/core/libwebsockets.c b/lib/core/libwebsockets.c\nindex e928328..128bbbd 100644\n--- a/lib/core/libwebsockets.c\n+++ b/lib/core/libwebsockets.c\n@@ -27,6 +27,7 @@\n #ifdef LWS_HAVE_SYS_TYPES_H\n #include \u003csys/types.h\u003e\n #endif\n+#include \u003csignal.h\u003e\n \n void\n lws_ser_wu16be(uint8_t *b, uint16_t u)\n@@ -1086,9 +1087,15 @@ lws_cmdline_option(int argc, const char **argv, const char *val)\n static const char * const builtins[] \u003d {\n \t\u0022-d\u0022,\n \t\u0022--udp-tx-loss\u0022,\n-\t\u0022--udp-rx-loss\u0022\n+\t\u0022--udp-rx-loss\u0022,\n+\t\u0022--ignore-sigterm\u0022\n };\n \n+static void\n+lws_sigterm_catch(int sig)\n+{\n+}\n+\n void\n lws_cmdline_option_handle_builtin(int argc, const char **argv,\n \t\t\t\t struct lws_context_creation_info *info)\n@@ -1113,6 +1120,9 @@ lws_cmdline_option_handle_builtin(int argc, const char **argv,\n \t\tcase 2:\n \t\t\tinfo-\u003eudp_loss_sim_rx_pc \u003d m;\n \t\t\tbreak;\n+\t\tcase 3:\n+\t\t\tsignal(SIGTERM, lws_sigterm_catch);\n+\t\t\tbreak;\n \t\t}\n \t}\n \ndiff --git a/lib/event-libs/libuv/libuv.c b/lib/event-libs/libuv/libuv.c\nindex 378a5dc..2b0883e 100644\n--- a/lib/event-libs/libuv/libuv.c\n+++ b/lib/event-libs/libuv/libuv.c\n@@ -545,7 +545,8 @@ elops_destroy_context2_uv(struct lws_context *context)\n static int\n elops_wsi_logical_close_uv(struct lws *wsi)\n {\n-\tif (!lws_socket_is_valid(wsi-\u003edesc.sockfd))\n+\tif (!lws_socket_is_valid(wsi-\u003edesc.sockfd) \u0026\u0026\n+\t wsi-\u003erole_ops !\u003d \u0026role_ops_raw_file)\n \t\treturn 0;\n \n \tif (wsi-\u003elistener || wsi-\u003eevent_pipe) {\n@@ -656,7 +657,7 @@ elops_io_uv(struct lws *wsi, int flags)\n \t}\n \n \tif (!w-\u003euv.pwatcher || wsi-\u003etold_event_loop_closed) {\n-\t\tlwsl_err(\u0022%s: no watcher\u005cn\u0022, __func__);\n+\t\tlwsl_info(\u0022%s: no watcher\u005cn\u0022, __func__);\n \n \t\treturn;\n \t}\ndiff --git a/lib/misc/lws-struct-lejp.c b/lib/misc/lws-struct-lejp.c\nindex c9a29cc..0d9009d 100644\n--- a/lib/misc/lws-struct-lejp.c\n+++ b/lib/misc/lws-struct-lejp.c\n@@ -138,7 +138,7 @@ lws_struct_default_lejp_cb(struct lejp_ctx *ctx, char reason)\n \tif (map-\u003etype \u003d\u003d LSMT_SCHEMA) {\n \n \t\twhile (n--) {\n-\t\t\tif (strcmp(map-\u003ecolname, ctx-\u003ebuf)) {\n+\t\t\tif (strncmp(map-\u003ecolname, ctx-\u003ebuf, ctx-\u003enpos)) {\n \t\t\t\tmap++;\n \t\t\t\tcontinue;\n \t\t\t}\n@@ -157,7 +157,9 @@ lws_struct_default_lejp_cb(struct lejp_ctx *ctx, char reason)\n \n \t\t\treturn 0;\n \t\t}\n-\t\tlwsl_notice(\u0022%s: unknown schema\u005cn\u0022, __func__);\n+\t\tlwsl_notice(\u0022%s: unknown schema %.*s, tried %d\u005cn\u0022, __func__,\n+\t\t\t\tctx-\u003enpos, ctx-\u003ebuf,\n+\t\t\t\t(int)args-\u003emap_entries_st[ctx-\u003epst_sp]);\n \n \t\tgoto cleanup;\n \t}\ndiff --git a/lib/misc/lws-struct-sqlite.c b/lib/misc/lws-struct-sqlite.c\nindex 6a53232..ef550c1 100644\n--- a/lib/misc/lws-struct-sqlite.c\n+++ b/lib/misc/lws-struct-sqlite.c\n@@ -511,7 +511,7 @@ lws_struct_sq3_open(struct lws_context *context, const char *sqlite3_path,\n \t\t\t SQLITE_OPEN_READWRITE |\n \t\t\t (create_if_missing ? SQLITE_OPEN_CREATE : 0),\n \t\t\t NULL) !\u003d SQLITE_OK) {\n-\t\tlwsl_err(\u0022%s: Unable to open db %s: %s\u005cn\u0022,\n+\t\tlwsl_info(\u0022%s: Unable to open db %s: %s\u005cn\u0022,\n \t\t\t __func__, sqlite3_path, sqlite3_errmsg(*pdb));\n \n \t\treturn 1;\n@@ -520,7 +520,8 @@ lws_struct_sq3_open(struct lws_context *context, const char *sqlite3_path,\n #if !defined(WIN32)\n \tlws_get_effective_uid_gid(context, \u0026uid, \u0026gid);\n \tif (uid)\n-\t\tchown(sqlite3_path, uid, gid);\n+\t\tif (chown(sqlite3_path, uid, gid))\n+\t\t\tlwsl_err(\u0022%s: failed to chown %s\u005cn\u0022, __func__, sqlite3_path);\n \tchmod(sqlite3_path, 0600);\n \n \tlwsl_debug(\u0022%s: created %s owned by %u:%u mode 0600\u005cn\u0022, __func__,\ndiff --git a/lib/misc/threadpool/threadpool.c b/lib/misc/threadpool/threadpool.c\nindex 916c9a3..0e1a98c 100644\n--- a/lib/misc/threadpool/threadpool.c\n+++ b/lib/misc/threadpool/threadpool.c\n@@ -319,9 +319,6 @@ lws_threadpool_tsi_context(struct lws_context *context, int tsi)\n \tstruct lws_threadpool_task **c, *task \u003d NULL;\n \tstruct lws_threadpool *tp;\n \tstruct lws *wsi;\n-\tchar some \u003d 0;\n-\n-\tlwsl_notice(\u0022%s\u005cn\u0022, __func__);\n \n \tlws_context_lock(context, __func__);\n \n@@ -340,10 +337,10 @@ lws_threadpool_tsi_context(struct lws_context *context, int tsi)\n \n \t\t\twsi \u003d task_to_wsi(task);\n \t\t\tif (!wsi || wsi-\u003etsi !\u003d tsi ||\n-\t\t\t !task-\u003ewanted_writeable_cb)\n+\t\t\t (!task-\u003ewanted_writeable_cb \u0026\u0026\n+\t\t\t task-\u003estatus !\u003d LWS_TP_STATUS_SYNCING))\n \t\t\t\tcontinue;\n \n-\t\t\tsome \u003d 1;\n \t\t\ttask-\u003ewanted_writeable_cb \u003d 0;\n \t\t\tlws_memory_barrier();\n \n@@ -365,9 +362,9 @@ lws_threadpool_tsi_context(struct lws_context *context, int tsi)\n \t\t\twsi \u003d task_to_wsi(task);\n \n \t\t\tif (wsi \u0026\u0026 wsi-\u003etsi \u003d\u003d tsi \u0026\u0026\n-\t\t\t task-\u003ewanted_writeable_cb) {\n+\t\t\t (task-\u003ewanted_writeable_cb ||\n+\t\t\t task-\u003estatus \u003d\u003d LWS_TP_STATUS_SYNCING)) {\n \n-\t\t\t\tsome \u003d 1;\n \t\t\t\ttask-\u003ewanted_writeable_cb \u003d 0;\n \t\t\t\tlws_memory_barrier();\n \n@@ -386,9 +383,6 @@ lws_threadpool_tsi_context(struct lws_context *context, int tsi)\n \t\ttp \u003d tp-\u003etp_list;\n \t}\n \n-\tif (!some)\n-\t\tlwsl_notice(\u0022%s: unable to find task wanting sync\u005cn\u0022, __func__);\n-\n \tlws_context_unlock(context);\n \n \treturn 0;\n@@ -829,6 +823,7 @@ lws_threadpool_destroy(struct lws_threadpool *tp)\n \n \tpthread_mutex_destroy(\u0026tp-\u003elock);\n \n+\tmemset(tp, 0xdd, sizeof(*tp));\n \tlws_free(tp);\n }\n \ndiff --git a/lib/plat/unix/unix-fds.c b/lib/plat/unix/unix-fds.c\nindex eaa255a..a236b9b 100644\n--- a/lib/plat/unix/unix-fds.c\n+++ b/lib/plat/unix/unix-fds.c\n@@ -182,7 +182,7 @@ delete_from_fd(const struct lws_context *context, int fd)\n \t\tp++;\n \n \tif (p \u003d\u003d done)\n-\t\tlwsl_err(\u0022%s: fd %d not found\u005cn\u0022, __func__, fd);\n+\t\tlwsl_debug(\u0022%s: fd %d not found\u005cn\u0022, __func__, fd);\n \telse\n \t\t*p \u003d NULL;\n \ndiff --git a/lib/plat/unix/unix-spawn.c b/lib/plat/unix/unix-spawn.c\nindex f5cf770..3f6ffbd 100644\n--- a/lib/plat/unix/unix-spawn.c\n+++ b/lib/plat/unix/unix-spawn.c\n@@ -110,6 +110,8 @@ lws_spawn_piped_destroy(struct lws_spawn_piped **_lsp)\n \n \tlws_sul_schedule(lsp-\u003einfo.vh-\u003econtext, lsp-\u003einfo.tsi, \u0026lsp-\u003esul,\n \t\t\t NULL, LWS_SET_TIMER_USEC_CANCEL);\n+\tlws_sul_schedule(lsp-\u003einfo.vh-\u003econtext, lsp-\u003einfo.tsi, \u0026lsp-\u003esul_reap,\n+\t\t\t NULL, LWS_SET_TIMER_USEC_CANCEL);\n \n \tfor (n \u003d 0; n \u003c 3; n++) {\n #if 0\n@@ -179,7 +181,8 @@ lws_spawn_reap(struct lws_spawn_piped *lsp)\n \t */\n \n \tif (!lsp-\u003eungraceful \u0026\u0026 lsp-\u003epipes_alive) {\n-\t\tlwsl_debug(\u0022%s: stdwsi alive, not reaping\u005cn\u0022, __func__);\n+\t\tlwsl_notice(\u0022%s: %d stdwsi alive, not reaping\u005cn\u0022, __func__,\n+\t\t\t\tlsp-\u003epipes_alive);\n \t\treturn 0;\n \t}\n \n@@ -326,9 +329,16 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i)\n \n \t/* create pipes for [stdin|stdout] and [stderr] */\n \n-\tfor (n \u003d 0; n \u003c 3; n++)\n+\tfor (n \u003d 0; n \u003c 3; n++) {\n \t\tif (pipe(lsp-\u003epipe_fds[n]) \u003d\u003d -1)\n \t\t\tgoto bail1;\n+\t\tlws_plat_apply_FD_CLOEXEC(lsp-\u003epipe_fds[n][n \u003d\u003d 0]);\n+\t}\n+\n+\t/*\n+\t * At this point, we have 6 pipe fds open on lws side and no wsis\n+\t * bound to them\n+\t */\n \n \t/* create wsis for each stdin/out/err fd */\n \n@@ -350,14 +360,26 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i)\n \n \t\t/* read side is 0, stdin we want the write side, others read */\n \n-\t\tlws_plat_apply_FD_CLOEXEC(lsp-\u003epipe_fds[n][n \u003d\u003d 0]);\n \t\tlsp-\u003estdwsi[n]-\u003edesc.sockfd \u003d lsp-\u003epipe_fds[n][n \u003d\u003d 0];\n \t\tif (fcntl(lsp-\u003epipe_fds[n][n \u003d\u003d 0], F_SETFL, O_NONBLOCK) \u003c 0) {\n \t\t\tlwsl_err(\u0022%s: setting NONBLOCK failed\u005cn\u0022, __func__);\n \t\t\tgoto bail2;\n \t\t}\n+\n+\t\t/*\n+\t\t * We have bound 3 x pipe fds to wsis, wr side of stdin and rd\n+\t\t * side of stdout / stderr... those are marked CLOEXEC so they\n+\t\t * won't go through the fork\n+\t\t *\n+\t\t * rd side of stdin and wr side of stdout / stderr are open but\n+\t\t * not bound to anything on lws side.\n+\t\t */\n \t}\n \n+\t/*\n+\t * Stitch the wsi fd into the poll wait\n+\t */\n+\n \tfor (n \u003d 0; n \u003c 3; n++) {\n \t\tif (context-\u003eevent_loop_ops-\u003esock_accept)\n \t\t\tif (context-\u003eevent_loop_ops-\u003esock_accept(lsp-\u003estdwsi[n]))\n@@ -384,7 +406,7 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i)\n \t\t lsp-\u003estdwsi[LWS_STDOUT]-\u003edesc.sockfd,\n \t\t lsp-\u003estdwsi[LWS_STDERR]-\u003edesc.sockfd);\n \n-\t/* we are ready with the redirection pipes... run the thing */\n+\t/* we are ready with the redirection pipes... do the (v)fork */\n #if !defined(LWS_HAVE_VFORK) || !defined(LWS_HAVE_EXECVPE)\n \tlsp-\u003echild_pid \u003d fork();\n #else\n@@ -407,15 +429,13 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i)\n \tif (lsp-\u003echild_pid) {\n \n \t\t/*\n-\t\t * We are the parent process\n-\t\t *\n-\t\t * close: stdin:r, stdout:w, stderr:w\n-\t\t * hide from other forks: stdin:w, stdout:r, stderr:r\n+\t\t * We are the parent process. We can close our copy of the\n+\t\t * \u0022other\u0022 side of the pipe fds, ie, rd for stdin and wr for\n+\t\t * stdout / stderr.\n \t\t */\n-\t\tfor (n \u003d 0; n \u003c 3; n++) {\n-\t\t\t/* these guys don't have any wsi footprint */\n+\t\tfor (n \u003d 0; n \u003c 3; n++)\n+\t\t\t/* these guys didn't have any wsi footprint */\n \t\t\tclose(lsp-\u003epipe_fds[n][n !\u003d 0]);\n-\t\t}\n \n \t\tlsp-\u003epipes_alive \u003d 3;\n \t\tlsp-\u003ecreated \u003d lws_now_usecs();\n@@ -460,26 +480,26 @@ lws_spawn_piped(const struct lws_spawn_piped_info *i)\n \tif (chdir(wd))\n \t\tlwsl_notice(\u0022%s: Failed to cd to %s\u005cn\u0022, __func__, wd);\n \n+\t/*\n+\t * Bind the child's stdin / out / err to its side of our pipes\n+\t */\n+\n \tfor (m \u003d 0; m \u003c 3; m++) {\n \t\tif (dup2(lsp-\u003epipe_fds[m][m !\u003d 0], m) \u003c 0) {\n \t\t\tlwsl_err(\u0022%s: stdin dup2 failed\u005cn\u0022, __func__);\n \t\t\tgoto bail3;\n \t\t}\n \t\t/*\n-\t\t * If we used fork(), then we can close both sides of the\n-\t\t * original pipe now we bound it to fd 0, 1, 2.\n+\t\t * CLOEXEC on the lws-side of the pipe fds should have already\n+\t\t * dealt with closing those for the child perspective.\n \t\t *\n-\t\t * But if we used vfork(), until the exec() we have hijacked\n-\t\t * the original process temporarily and we are (ab)using its\n-\t\t * identity during this pre-exec() time\n+\t\t * Now it has done the dup, the child should close its original\n+\t\t * copies of its side of the pipes.\n \t\t */\n-#if !defined(LWS_HAVE_VFORK) || !defined(LWS_HAVE_EXECVPE)\n+\n \t\tclose(lsp-\u003epipe_fds[m][m !\u003d 0]);\n-#endif\n \t}\n \n-\t// lwsl_notice(\u0022%s: child cd %s, exec %s\u005cn\u0022, __func__, wd, i-\u003eexec_array[0]);\n-\n #if !defined(LWS_HAVE_VFORK) || !defined(LWS_HAVE_EXECVPE)\n #if defined(__linux__)\n \tm \u003d 0;\ndiff --git a/lib/plat/windows/windows-spawn.c b/lib/plat/windows/windows-spawn.c\nindex 1269e14..fcc11c6 100644\n--- a/lib/plat/windows/windows-spawn.c\n+++ b/lib/plat/windows/windows-spawn.c\n@@ -128,6 +128,9 @@ lws_spawn_piped_destroy(struct lws_spawn_piped **_lsp)\n \tlws_sul_schedule(lsp-\u003einfo.vh-\u003econtext, lsp-\u003einfo.tsi, \u0026lsp-\u003esul,\n \t\t\t NULL, LWS_SET_TIMER_USEC_CANCEL);\n \n+\tlws_sul_schedule(lsp-\u003econtext, 0, \u0026lsp-\u003esul_reap, NULL,\n+\t\t\t LWS_SET_TIMER_USEC_CANCEL);\n+\n \tlws_sul_schedule(lsp-\u003econtext, 0, \u0026lsp-\u003esul_poll, NULL,\n \t\t\t LWS_SET_TIMER_USEC_CANCEL);\n \ndiff --git a/lib/roles/cgi/ops-cgi.c b/lib/roles/cgi/ops-cgi.c\nindex 6217335..63863c3 100644\n--- a/lib/roles/cgi/ops-cgi.c\n+++ b/lib/roles/cgi/ops-cgi.c\n@@ -113,6 +113,15 @@ rops_pt_init_destroy_cgi(struct lws_context *context,\n \treturn 0;\n }\n \n+static int\n+rops_close_role_cgi(struct lws_context_per_thread *pt, struct lws *wsi)\n+{\n+\tif (wsi-\u003eparent \u0026\u0026 wsi-\u003eparent-\u003ehttp.cgi \u0026\u0026 wsi-\u003eparent-\u003ehttp.cgi-\u003elsp)\n+\t\tlws_spawn_stdwsi_closed(wsi-\u003eparent-\u003ehttp.cgi-\u003elsp, wsi);\n+\n+\treturn 0;\n+}\n+\n \n const struct lws_role_ops role_ops_cgi \u003d {\n \t/* role name */\t\t\t\u0022cgi\u0022,\n@@ -131,7 +140,7 @@ const struct lws_role_ops role_ops_cgi \u003d {\n \t/* encapsulation_parent */\tNULL,\n \t/* alpn_negotiated */\t\tNULL,\n \t/* close_via_role_protocol */\tNULL,\n-\t/* close_role */\t\tNULL,\n+\t/* close_role */\t\trops_close_role_cgi,\n \t/* close_kill_connection */\tNULL,\n \t/* destroy_role */\t\trops_destroy_role_cgi,\n \t/* adoption_bind */\t\tNULL,\ndiff --git a/lib/roles/http/client/client-http.c b/lib/roles/http/client/client-http.c\nindex 8e1b6a3..8cf66a2 100644\n--- a/lib/roles/http/client/client-http.c\n+++ b/lib/roles/http/client/client-http.c\n@@ -28,11 +28,11 @@\n int\n lws_client_create_tls(struct lws *wsi, const char **pcce, int do_c1)\n {\n-\tint n;\n \n \t/* we can retry this... just cook the SSL BIO the first time */\n \n \tif (wsi-\u003etls.use_ssl \u0026 LCCSCF_USE_SSL) {\n+\t\tint n;\n \n \t\tif (!wsi-\u003etls.ssl) {\n \t\t\tif (lws_ssl_client_bio_create(wsi) \u003c 0) {\n@@ -50,12 +50,13 @@ lws_client_create_tls(struct lws *wsi, const char **pcce, int do_c1)\n \t\tif (!do_c1)\n \t\t\treturn 0;\n \n-\t\tn \u003d lws_ssl_client_connect1(wsi);\n+\t\tn \u003d lws_ssl_client_connect1(wsi, (char *)wsi-\u003econtext-\u003ept[(int)wsi-\u003etsi].serv_buf,\n+\t\t\t\t\t wsi-\u003econtext-\u003ept_serv_buf_size);\n \t\tlwsl_debug(\u0022%s: lws_ssl_client_connect1: %d\u005cn\u0022, __func__, n);\n \t\tif (!n)\n \t\t\treturn CCTLS_RETURN_RETRY; /* caller should return 0 */\n \t\tif (n \u003c 0) {\n-\t\t\t*pcce \u003d \u0022lws_ssl_client_connect1 failed\u0022;\n+\t\t\t*pcce \u003d (const char *)wsi-\u003econtext-\u003ept[(int)wsi-\u003etsi].serv_buf;\n \t\t\treturn CCTLS_RETURN_ERROR;\n \t\t}\n \t} else\n@@ -485,6 +486,8 @@ bail3:\n \t\t\t\t__func__, wsi, lwsi_state(wsi));\n \t\tif (cce)\n \t\t\tlwsl_info(\u0022reason: %s\u005cn\u0022, cce);\n+\t\telse\n+\t\t\tcce \u003d \u0022unknown\u0022;\n \t\tlws_inform_client_conn_fail(wsi, (void *)cce, strlen(cce));\n \n \t\tlws_close_free_wsi(wsi, LWS_CLOSE_STATUS_NOSTATUS, \u0022cbail3\u0022);\ndiff --git a/lib/roles/ws/client-ws.c b/lib/roles/ws/client-ws.c\nindex 802125a..9a8c609 100644\n--- a/lib/roles/ws/client-ws.c\n+++ b/lib/roles/ws/client-ws.c\n@@ -131,7 +131,7 @@ lws_ws_handshake_client(struct lws *wsi, unsigned char **buf, size_t len)\n \t\t */\n \n \t\tif (lws_ws_client_rx_sm(wsi, *(*buf)++)) {\n-\t\t\tlwsl_notice(\u0022%s: client_rx_sm exited, DROPPING %d\u005cn\u0022,\n+\t\t\tlwsl_info(\u0022%s: client_rx_sm exited, DROPPING %d\u005cn\u0022,\n \t\t\t\t __func__, (int)len);\n \t\t\treturn -1;\n \t\t}\ndiff --git a/lib/tls/mbedtls/mbedtls-client.c b/lib/tls/mbedtls/mbedtls-client.c\nindex fa9aed7..0eac6b5 100644\n--- a/lib/tls/mbedtls/mbedtls-client.c\n+++ b/lib/tls/mbedtls/mbedtls-client.c\n@@ -167,7 +167,7 @@ int ERR_get_error(void)\n }\n \n enum lws_ssl_capable_status\n-lws_tls_client_connect(struct lws *wsi)\n+lws_tls_client_connect(struct lws *wsi, char *errbuf, int elen)\n {\n \tint m, n \u003d SSL_connect(wsi-\u003etls.ssl);\n \tconst unsigned char *prot;\n@@ -191,6 +191,8 @@ lws_tls_client_connect(struct lws *wsi)\n \tif (!n) /* we don't know what he wants, but he says to retry */\n \t\treturn LWS_SSL_CAPABLE_MORE_SERVICE;\n \n+\tlws_snprintf(errbuf, elen, \u0022mbedtls connect %d %d %d\u0022, n, m, errno);\n+\n \treturn LWS_SSL_CAPABLE_ERROR;\n }\n \ndiff --git a/lib/tls/mbedtls/mbedtls-server.c b/lib/tls/mbedtls/mbedtls-server.c\nindex d7a9355..f0dcb6e 100644\n--- a/lib/tls/mbedtls/mbedtls-server.c\n+++ b/lib/tls/mbedtls/mbedtls-server.c\n@@ -325,7 +325,7 @@ lws_tls_server_accept(struct lws *wsi)\n \t}\n \n \tm \u003d SSL_get_error(wsi-\u003etls.ssl, n);\n-\tlwsl_debug(\u0022%s: %p: accept SSL_get_error %d errno %d\u005cn\u0022, __func__,\n+\tlwsl_notice(\u0022%s: %p: accept SSL_get_error %d errno %d\u005cn\u0022, __func__,\n \t\t wsi, m, errno);\n \n \t// mbedtls wrapper only\ndiff --git a/lib/tls/openssl/openssl-client.c b/lib/tls/openssl/openssl-client.c\nindex e4d33d8..1a6e535 100644\n--- a/lib/tls/openssl/openssl-client.c\n+++ b/lib/tls/openssl/openssl-client.c\n@@ -376,7 +376,7 @@ no_client_cert:\n }\n \n enum lws_ssl_capable_status\n-lws_tls_client_connect(struct lws *wsi)\n+lws_tls_client_connect(struct lws *wsi, char *errbuf, int elen)\n {\n #if defined(LWS_HAVE_SSL_set_alpn_protos) \u0026\u0026 \u005c\n defined(LWS_HAVE_SSL_get0_alpn_selected)\n@@ -384,17 +384,13 @@ lws_tls_client_connect(struct lws *wsi)\n \tchar a[32];\n \tunsigned int len;\n #endif\n-\tint m, n;\n-#if defined(WIN32) || (_LWS_ENABLED_LOGS \u0026 LLL_INFO)\n-\tint en;\n-#endif\n+\tint m, n, en;\n \n \terrno \u003d 0;\n \tERR_clear_error();\n \tn \u003d SSL_connect(wsi-\u003etls.ssl);\n-#if defined(WIN32) || (_LWS_ENABLED_LOGS \u0026 LLL_INFO)\n \ten \u003d errno;\n-#endif\n+\n \tm \u003d lws_ssl_get_error(wsi, n);\n \n \tif (m \u003d\u003d SSL_ERROR_SYSCALL\n@@ -405,11 +401,15 @@ lws_tls_client_connect(struct lws *wsi)\n #if defined(WIN32) || (_LWS_ENABLED_LOGS \u0026 LLL_INFO)\n \t\tlwsl_info(\u0022%s: n %d, m %d, errno %d\u005cn\u0022, __func__, n, m, en);\n #endif\n+\t\tlws_snprintf(errbuf, elen, \u0022connect SYSCALL %d\u0022, en);\n \t\treturn LWS_SSL_CAPABLE_ERROR;\n \t}\n \n-\tif (m \u003d\u003d SSL_ERROR_SSL)\n+\tif (m \u003d\u003d SSL_ERROR_SSL) {\n+\t\tn \u003d lws_snprintf(errbuf, elen, \u0022connect SSL err %d: \u0022, m);\n+\t\tERR_error_string_n(m, errbuf + n, elen - n);\n \t\treturn LWS_SSL_CAPABLE_ERROR;\n+\t}\n \n \tif (m \u003d\u003d SSL_ERROR_WANT_READ || SSL_want_read(wsi-\u003etls.ssl))\n \t\treturn LWS_SSL_CAPABLE_MORE_SERVICE_READ;\n@@ -437,6 +437,8 @@ lws_tls_client_connect(struct lws *wsi)\n \tif (!n) /* we don't know what he wants, but he says to retry */\n \t\treturn LWS_SSL_CAPABLE_MORE_SERVICE;\n \n+\tlws_snprintf(errbuf, elen, \u0022connect unk %d\u0022, m);\n+\n \treturn LWS_SSL_CAPABLE_ERROR;\n }\n \ndiff --git a/lib/tls/openssl/openssl-ssl.c b/lib/tls/openssl/openssl-ssl.c\nindex 1f2fd82..e1f8bd4 100644\n--- a/lib/tls/openssl/openssl-ssl.c\n+++ b/lib/tls/openssl/openssl-ssl.c\n@@ -60,7 +60,7 @@ int lws_ssl_get_error(struct lws *wsi, int n)\n \tlwsl_debug(\u0022%s: %p %d -\u003e %d (errno %d)\u005cn\u0022, __func__, wsi-\u003etls.ssl, n, m,\n \t\t errno);\n \n-\tassert (errno !\u003d 9);\n+\t// assert (errno !\u003d 9);\n \n \treturn m;\n }\ndiff --git a/lib/tls/private-network.h b/lib/tls/private-network.h\nindex 88474fc..0cb9232 100644\n--- a/lib/tls/private-network.h\n+++ b/lib/tls/private-network.h\n@@ -102,7 +102,7 @@ lws_ssl_remove_wsi_from_buffered_list(struct lws *wsi);\n LWS_EXTERN int\n lws_ssl_client_bio_create(struct lws *wsi);\n LWS_EXTERN int\n-lws_ssl_client_connect1(struct lws *wsi);\n+lws_ssl_client_connect1(struct lws *wsi, char *errbuf, int len);\n LWS_EXTERN int\n lws_ssl_client_connect2(struct lws *wsi, char *errbuf, int len);\n LWS_EXTERN int\n@@ -158,7 +158,7 @@ LWS_EXTERN enum lws_ssl_capable_status\n __lws_tls_shutdown(struct lws *wsi);\n \n LWS_EXTERN enum lws_ssl_capable_status\n-lws_tls_client_connect(struct lws *wsi);\n+lws_tls_client_connect(struct lws *wsi, char *errbuf, int len);\n LWS_EXTERN int\n lws_tls_client_confirm_peer_cert(struct lws *wsi, char *ebuf, int ebuf_len);\n LWS_EXTERN int\ndiff --git a/lib/tls/tls-client.c b/lib/tls/tls-client.c\nindex b1b2da7..a3d4553 100644\n--- a/lib/tls/tls-client.c\n+++ b/lib/tls/tls-client.c\n@@ -25,11 +25,11 @@\n #include \u0022private-lib-core.h\u0022\n \n int\n-lws_ssl_client_connect1(struct lws *wsi)\n+lws_ssl_client_connect1(struct lws *wsi, char *errbuf, int len)\n {\n \tint n;\n \n-\tn \u003d lws_tls_client_connect(wsi);\n+\tn \u003d lws_tls_client_connect(wsi, errbuf, len);\n \tswitch (n) {\n \tcase LWS_SSL_CAPABLE_ERROR:\n \t\treturn -1;\n@@ -53,12 +53,12 @@ lws_ssl_client_connect2(struct lws *wsi, char *errbuf, int len)\n \tint n;\n \n \tif (lwsi_state(wsi) \u003d\u003d LRS_WAITING_SSL) {\n-\t\tn \u003d lws_tls_client_connect(wsi);\n+\t\tn \u003d lws_tls_client_connect(wsi, errbuf, len);\n \t\tlwsl_debug(\u0022%s: SSL_connect says %d\u005cn\u0022, __func__, n);\n \n \t\tswitch (n) {\n \t\tcase LWS_SSL_CAPABLE_ERROR:\n-\t\t\tlws_snprintf(errbuf, len, \u0022client connect failed\u0022);\n+\t\t\t// lws_snprintf(errbuf, len, \u0022client connect failed\u0022);\n \t\t\treturn -1;\n \t\tcase LWS_SSL_CAPABLE_DONE:\n \t\t\tbreak; /* connected */\ndiff --git a/minimal-examples/api-tests/api-test-async-dns/CMakeLists.txt b/minimal-examples/api-tests/api-test-async-dns/CMakeLists.txt\nindex 61a0827..461800d 100644\n--- a/minimal-examples/api-tests/api-test-async-dns/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-async-dns/CMakeLists.txt\n@@ -69,6 +69,11 @@ require_lws_config(LWS_WITH_SYS_ASYNC_DNS 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n+\tadd_test(NAME api-test-async-dns COMMAND lws-api-test-async-dns)\n+\tset_tests_properties(api-test-async-dns\n+\t\t\t PROPERTIES\n+\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/api-tests/api-test-async-dns\n+\t\t\t TIMEOUT 60)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/api-tests/api-test-async-dns/selftest.sh b/minimal-examples/api-tests/api-test-async-dns/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-async-dns/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-fts/selftest.sh b/minimal-examples/api-tests/api-test-fts/selftest.sh\ndeleted file mode 100755\nindex 03e7d49..0000000\n--- a/minimal-examples/api-tests/api-test-fts/selftest.sh\n+++ /dev/null\n@@ -1,58 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d4\n-\n-FAILS\u003d0\n-\n-#\n-# let's make an index with just Dorian first\n-#\n-dotest $1 $2 apitest -c -i /tmp/lws-fts-dorian.index \u005c\n- \u0022../minimal-examples/api-tests/api-test-fts/the-picture-of-dorian-gray.txt\u0022\n-\n-# and let's hear about autocompletes for \u0022b\u0022\n-\n-dotest $1 $2 apitest -i /tmp/lws-fts-dorian.index b\n-cat $2/api-test-fts/apitest.log | cut -d' ' -f5- \u003e /tmp/fts1\n-diff -urN /tmp/fts1 \u0022../minimal-examples/api-tests/api-test-fts/canned-1.txt\u0022\n-if [ $? -ne 0 ] ; then\n-\techo \u0022Test 1 failed\u0022\n-\tFAILS\u003d$(( $FAILS + 1 ))\n-fi\n-\n-#\n-# let's make an index with Dorian + Les Mis in French (ie, UTF-8) as well\n-#\n-dotest $1 $2 apitest -c -i /tmp/lws-fts-both.index \u005c\n- \u0022../minimal-examples/api-tests/api-test-fts/the-picture-of-dorian-gray.txt\u0022 \u005c\n- \u0022../minimal-examples/api-tests/api-test-fts/les-mis-utf8.txt\u0022\n-\n-# and let's hear about \u0022help\u0022, which appears in both\n-\n-dotest $1 $2 apitest -i /tmp/lws-fts-both.index -f -l help\n-cat $2/api-test-fts/apitest.log | cut -d' ' -f5- \u003e /tmp/fts2\n-diff -urN /tmp/fts2 \u0022../minimal-examples/api-tests/api-test-fts/canned-2.txt\u0022\n-if [ $? -ne 0 ] ; then\n-\techo \u0022Test 1 failed\u0022\n-\tFAILS\u003d$(( $FAILS + 1 ))\n-fi\n-\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-gencrypto/CMakeLists.txt b/minimal-examples/api-tests/api-test-gencrypto/CMakeLists.txt\nindex cfeac87..0356ab8 100644\n--- a/minimal-examples/api-tests/api-test-gencrypto/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-gencrypto/CMakeLists.txt\n@@ -70,6 +70,7 @@ require_lws_config(LWS_WITH_JOSE 1 requirements)\n if (requirements)\n \n \tadd_executable(${SAMP} ${SRCS})\n+\tadd_test(NAME api-test-gencrypto COMMAND lws-api-test-gencrypto)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/api-tests/api-test-gencrypto/selftest.sh b/minimal-examples/api-tests/api-test-gencrypto/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-gencrypto/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-jose/CMakeLists.txt b/minimal-examples/api-tests/api-test-jose/CMakeLists.txt\nindex 81c0cf8..33ae85b 100644\n--- a/minimal-examples/api-tests/api-test-jose/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-jose/CMakeLists.txt\n@@ -69,6 +69,10 @@ if (requirements)\n \n \tadd_executable(${SAMP} ${SRCS})\n \n+\tif (NOT (LWS_WITH_MBEDTLS AND NOT LWS_HAVE_mbedtls_internal_aes_encrypt))\n+\t\tadd_test(NAME api-test-jose COMMAND lws-api-test-jose)\n+\tendif()\n+\n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\n \t\tadd_dependencies(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/api-tests/api-test-jose/selftest.sh b/minimal-examples/api-tests/api-test-jose/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-jose/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-lws_dsh/CMakeLists.txt b/minimal-examples/api-tests/api-test-lws_dsh/CMakeLists.txt\nindex 262b4f0..99aea9f 100644\n--- a/minimal-examples/api-tests/api-test-lws_dsh/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-lws_dsh/CMakeLists.txt\n@@ -69,6 +69,7 @@ require_lws_config(LWS_WITH_LWS_DSH 1 requirements)\n if (requirements)\n \n \tadd_executable(${SAMP} ${SRCS})\n+\tadd_test(NAME api-test-lws_dsh COMMAND lws-api-test-lws_dsh)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/api-tests/api-test-lws_dsh/selftest.sh b/minimal-examples/api-tests/api-test-lws_dsh/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-lws_dsh/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-lws_struct-json/CMakeLists.txt b/minimal-examples/api-tests/api-test-lws_struct-json/CMakeLists.txt\nindex b931750..5028710 100644\n--- a/minimal-examples/api-tests/api-test-lws_struct-json/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-lws_struct-json/CMakeLists.txt\n@@ -68,6 +68,7 @@ require_lws_config(LWS_WITH_STRUCT_JSON 1 requirements)\n if (requirements)\n \n \tadd_executable(${SAMP} ${SRCS})\n+\tadd_test(NAME api-test-lws_struct-json COMMAND lws-api-test-lws_struct-json)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/api-tests/api-test-lws_struct-json/main.c b/minimal-examples/api-tests/api-test-lws_struct-json/main.c\nindex 4083f32..faa2650 100644\n--- a/minimal-examples/api-tests/api-test-lws_struct-json/main.c\n+++ b/minimal-examples/api-tests/api-test-lws_struct-json/main.c\n@@ -296,6 +296,35 @@ static const lws_struct_map_t lsm_schema_map[] \u003d {\n \t\t\t lsm_other,\t\t\u0022com-warmcat-sai-other\u0022),\n };\n \n+typedef struct sai_cancel {\n+\tchar task_uuid[65];\n+} sai_cancel_t;\n+\n+const lws_struct_map_t lsm_task_cancel[] \u003d {\n+\tLSM_CARRAY\t(sai_cancel_t, task_uuid,\t \u0022uuid\u0022),\n+};\n+\n+static const lws_struct_map_t t2_map[] \u003d {\n+\tLSM_SCHEMA\t(sai_cancel_t, NULL, lsm_task_cancel,\n+\t\t\t\t\t \u0022com.warmcat.sai.taskinfo\u0022),\n+\tLSM_SCHEMA\t(sai_cancel_t, NULL, lsm_task_cancel,\n+\t\t\t\t\t \u0022com.warmcat.sai.eventinfo\u0022),\n+\tLSM_SCHEMA\t(sai_cancel_t, NULL, lsm_task_cancel,\n+\t\t\t/* shares struct */ \u0022com.warmcat.sai.taskreset\u0022),\n+\tLSM_SCHEMA\t(sai_cancel_t, NULL, lsm_task_cancel,\n+\t\t\t/* shares struct */ \u0022com.warmcat.sai.eventreset\u0022),\n+\tLSM_SCHEMA\t(sai_cancel_t, NULL, lsm_task_cancel,\n+\t\t\t/* shares struct */ \u0022com.warmcat.sai.eventdelete\u0022),\n+\tLSM_SCHEMA\t(sai_cancel_t,\t\t NULL, lsm_task_cancel,\n+\t\t\t\t\t \u0022com.warmcat.sai.taskcan\u0022),\n+};\n+\n+static const char *t2 \u003d\n+\t\u0022{\u005c\u0022schema\u005c\u0022:\u005c\u0022com.warmcat.sai.taskcan\u005c\u0022,\u0022\n+\t \u0022\u005c\u0022uuid\u005c\u0022: \u005c\u0022071ab46ab4296e5de674c628fec17c55088254679f7714ad991f8c4873dca\u005c\u0022}\u005cx01\u005cx02\u005cxff\u005cxff\u005cxff\u005cxff\u0022;\n+\n+\n+\n static int\n show_target(struct lws_dll2 *d, void *user)\n {\ndiff --git a/minimal-examples/api-tests/api-test-lws_struct-json/selftest.sh b/minimal-examples/api-tests/api-test-lws_struct-json/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-lws_struct-json/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt b/minimal-examples/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt\nindex f1496c2..00ea42c 100644\n--- a/minimal-examples/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt\n@@ -63,11 +63,12 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n-require_lws_config(LWS_WITH_STRUCT_SQLITE 1 requirements)\n+require_lws_config(LWS_WITH_STRUCT_SQLITE3 1 requirements)\n \n if (requirements)\n \n \tadd_executable(${SAMP} ${SRCS})\n+\tadd_test(NAME api-test-lws_struct_sqlite COMMAND lws-api-test-lws_struct-sqlite)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared sqlite3)\ndiff --git a/minimal-examples/api-tests/api-test-lws_struct_sqlite/selftest.sh b/minimal-examples/api-tests/api-test-lws_struct_sqlite/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-lws_struct_sqlite/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-lws_tokenize/CMakeLists.txt b/minimal-examples/api-tests/api-test-lws_tokenize/CMakeLists.txt\nindex 26b3f1f..7eb968b 100644\n--- a/minimal-examples/api-tests/api-test-lws_tokenize/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-lws_tokenize/CMakeLists.txt\n@@ -62,9 +62,8 @@ MACRO(require_lws_config reqconfig _val result)\n \tendif()\n ENDMACRO()\n \n-\n-\n \tadd_executable(${SAMP} ${SRCS})\n+\tadd_test(NAME api-test-lws_tokenize COMMAND lws-api-test-lws_tokenize)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/api-tests/api-test-lws_tokenize/selftest.sh b/minimal-examples/api-tests/api-test-lws_tokenize/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-lws_tokenize/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/api-tests/api-test-lwsac/CMakeLists.txt b/minimal-examples/api-tests/api-test-lwsac/CMakeLists.txt\nindex c5ad317..7e147a7 100644\n--- a/minimal-examples/api-tests/api-test-lwsac/CMakeLists.txt\n+++ b/minimal-examples/api-tests/api-test-lwsac/CMakeLists.txt\n@@ -62,9 +62,8 @@ MACRO(require_lws_config reqconfig _val result)\n \tendif()\n ENDMACRO()\n \n-\n-\n \tadd_executable(${SAMP} ${SRCS})\n+\tadd_test(NAME api-test-lwsac COMMAND lws-api-test-lwsac)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/api-tests/api-test-lwsac/selftest.sh b/minimal-examples/api-tests/api-test-lwsac/selftest.sh\ndeleted file mode 100755\nindex 16d1e2e..0000000\n--- a/minimal-examples/api-tests/api-test-lwsac/selftest.sh\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 apiselftest\n-exit $FAILS\ndiff --git a/minimal-examples/dbus-client/minimal-dbus-client/CMakeLists.txt b/minimal-examples/dbus-client/minimal-dbus-client/CMakeLists.txt\nindex 9d3f451..3e361b4 100644\n--- a/minimal-examples/dbus-client/minimal-dbus-client/CMakeLists.txt\n+++ b/minimal-examples/dbus-client/minimal-dbus-client/CMakeLists.txt\n@@ -6,42 +6,6 @@ include(CheckLibraryExists)\n set(SAMP lws-minimal-dbus-client)\n set(SRCS minimal-dbus-client.c)\n \n-if (NOT LWS_WITH_MINIMAL_EXAMPLES)\n-\tCHECK_LIBRARY_EXISTS(dbus-1 dbus_connection_set_watch_functions \u0022\u0022 LWS_HAVE_LIBDBUS)\n-\tif (NOT LWS_HAVE_LIBDBUS)\n-\t\tmessage(FATAL_ERROR \u0022Install dbus-devel, or libdbus-1-dev etc\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_LIB)\n-\t\tset(LWS_DBUS_LIB \u0022dbus-1\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE1)\n-\t\t# look in fedora and debian / ubuntu place\n-\t\tif (EXISTS \u0022/usr/include/dbus-1.0\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE1 \u0022/usr/include/dbus-1.0\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE1 to /usr/include/dbus-1.0 or wherever the main dbus includes are\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE2)\n-\t\t# look in fedora... debian / ubuntu has the ARCH in the path...\n-\t\tif (EXISTS \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE2 \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE2 to /usr/lib/ARCH-linux-gnu/dbus-1.0/include or wherever dbus-arch-deps.h is on your system\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tset(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${LWS_DBUS_INCLUDE1};${LWS_DBUS_INCLUDE2})\n-\n-\tif (NOT LWS_DBUS_INCLUDE1 OR NOT LWS_DBUS_INCLUDE2)\n-\t\tmessage(FATAL_ERROR \u0022To build with libdbus, LWS_DBUS_INCLUDE1/2 must be given. See lib/roles/dbus/README.md\u0022)\n-\tendif()\n-\n-endif()\n-\n # If we are being built as part of lws, confirm current build config supports\n # reqconfig, else skip building ourselves.\n #\n@@ -107,10 +71,15 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n-\t\n+\n+\tif (NOT LWS_PLAT_FREERTOS)\n+\t\tfind_package(PkgConfig QUIET)\n+\t\tpkg_check_modules(PC_DBUS1 dbus-1 QUIET)\n+\t\tlist(APPEND LWS_DBUS_INCLUDE1 ${PC_DBUS1_INCLUDE_DIRS})\n+\t\tlist(APPEND LWS_DBUS_LIB \u0022${PC_DBUS1_LIBRARIES};dl\u0022)\n+\tendif()\n+\n \tinclude_directories(\u0022${LWS_DBUS_INCLUDE1}\u0022)\n-\tinclude_directories(\u0022${LWS_DBUS_INCLUDE2}\u0022)\n-\tlist(APPEND LIB_LIST dbus-1)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt b/minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt\nindex 0ec0cca..dbc8195 100644\n--- a/minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt\n+++ b/minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt\n@@ -6,42 +6,6 @@ include(CheckLibraryExists)\n set(SAMP lws-minimal-dbus-ws-proxy-testclient)\n set(SRCS minimal-dbus-ws-proxy-testclient.c)\n \n-if (NOT LWS_WITH_MINIMAL_EXAMPLES)\n-\tCHECK_LIBRARY_EXISTS(dbus-1 dbus_connection_set_watch_functions \u0022\u0022 LWS_HAVE_LIBDBUS)\n-\tif (NOT LWS_HAVE_LIBDBUS)\n-\t\tmessage(FATAL_ERROR \u0022Install dbus-devel, or libdbus-1-dev etc\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_LIB)\n-\t\tset(LWS_DBUS_LIB \u0022dbus-1\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE1)\n-\t\t# look in fedora and debian / ubuntu place\n-\t\tif (EXISTS \u0022/usr/include/dbus-1.0\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE1 \u0022/usr/include/dbus-1.0\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE1 to /usr/include/dbus-1.0 or wherever the main dbus includes are\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE2)\n-\t\t# look in fedora... debian / ubuntu has the ARCH in the path...\n-\t\tif (EXISTS \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE2 \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE2 to /usr/lib/ARCH-linux-gnu/dbus-1.0/include or wherever dbus-arch-deps.h is on your system\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tset(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${LWS_DBUS_INCLUDE1};${LWS_DBUS_INCLUDE2})\n-\n-\tif (NOT LWS_DBUS_INCLUDE1 OR NOT LWS_DBUS_INCLUDE2)\n-\t\tmessage(FATAL_ERROR \u0022To build with libdbus, LWS_DBUS_INCLUDE1/2 must be given. See lib/roles/dbus/README.md\u0022)\n-\tendif()\n-\n-endif()\n-\n # If we are being built as part of lws, confirm current build config supports\n # reqconfig, else skip building ourselves.\n #\n@@ -107,10 +71,15 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n-\t\n+\n+\tif (NOT LWS_PLAT_FREERTOS)\n+\t\tfind_package(PkgConfig QUIET)\n+\t\tpkg_check_modules(PC_DBUS1 dbus-1 QUIET)\n+\t\tlist(APPEND LWS_DBUS_INCLUDE1 ${PC_DBUS1_INCLUDE_DIRS})\n+\t\tlist(APPEND LWS_DBUS_LIB \u0022${PC_DBUS1_LIBRARIES};dl\u0022)\n+\tendif()\n+\n \tinclude_directories(\u0022${LWS_DBUS_INCLUDE1}\u0022)\n-\tinclude_directories(\u0022${LWS_DBUS_INCLUDE2}\u0022)\n-\tlist(APPEND LIB_LIST dbus-1)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/dbus-server/minimal-dbus-server/CMakeLists.txt b/minimal-examples/dbus-server/minimal-dbus-server/CMakeLists.txt\nindex 37e49f0..105bb5c 100644\n--- a/minimal-examples/dbus-server/minimal-dbus-server/CMakeLists.txt\n+++ b/minimal-examples/dbus-server/minimal-dbus-server/CMakeLists.txt\n@@ -6,42 +6,6 @@ include(CheckLibraryExists)\n set(SAMP lws-minimal-dbus-server)\n set(SRCS main.c)\n \n-if (NOT LWS_WITH_MINIMAL_EXAMPLES)\n-\tCHECK_LIBRARY_EXISTS(dbus-1 dbus_connection_set_watch_functions \u0022\u0022 LWS_HAVE_LIBDBUS)\n-\tif (NOT LWS_HAVE_LIBDBUS)\n-\t\tmessage(FATAL_ERROR \u0022Install dbus-devel, or libdbus-1-dev etc\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_LIB)\n-\t\tset(LWS_DBUS_LIB \u0022dbus-1\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE1)\n-\t\t# look in fedora and debian / ubuntu place\n-\t\tif (EXISTS \u0022/usr/include/dbus-1.0\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE1 \u0022/usr/include/dbus-1.0\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE1 to /usr/include/dbus-1.0 or wherever the main dbus includes are\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE2)\n-\t\t# look in fedora... debian / ubuntu has the ARCH in the path...\n-\t\tif (EXISTS \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE2 \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE2 to /usr/lib/ARCH-linux-gnu/dbus-1.0/include or wherever dbus-arch-deps.h is on your system\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tset(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${LWS_DBUS_INCLUDE1};${LWS_DBUS_INCLUDE2})\n-\n-\tif (NOT LWS_DBUS_INCLUDE1 OR NOT LWS_DBUS_INCLUDE2)\n-\t\tmessage(FATAL_ERROR \u0022To build with libdbus, LWS_DBUS_INCLUDE1/2 must be given. See lib/roles/dbus/README.md\u0022)\n-\tendif()\n-\n-endif()\n-\n # If we are being built as part of lws, confirm current build config supports\n # reqconfig, else skip building ourselves.\n #\n@@ -107,10 +71,15 @@ require_lws_config(LWS_WITH_SERVER 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n-\t\n+\n+\tif (NOT LWS_PLAT_FREERTOS)\n+\t\tfind_package(PkgConfig QUIET)\n+\t\tpkg_check_modules(PC_DBUS1 dbus-1 QUIET)\n+\t\tlist(APPEND LWS_DBUS_INCLUDE1 ${PC_DBUS1_INCLUDE_DIRS})\n+\t\tlist(APPEND LWS_DBUS_LIB \u0022${PC_DBUS1_LIBRARIES};dl\u0022)\n+\tendif()\n+\n \tinclude_directories(\u0022${LWS_DBUS_INCLUDE1}\u0022)\n-\tinclude_directories(\u0022${LWS_DBUS_INCLUDE2}\u0022)\n-\tlist(APPEND LIB_LIST dbus-1)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt b/minimal-examples/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt\nindex bd5148c..9068a7b 100644\n--- a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt\n+++ b/minimal-examples/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt\n@@ -6,42 +6,6 @@ include(CheckLibraryExists)\n set(SAMP lws-minimal-dbus-ws-proxy)\n set(SRCS main.c)\n \n-if (NOT LWS_WITH_MINIMAL_EXAMPLES)\n-\tCHECK_LIBRARY_EXISTS(dbus-1 dbus_connection_set_watch_functions \u0022\u0022 LWS_HAVE_LIBDBUS)\n-\tif (NOT LWS_HAVE_LIBDBUS)\n-\t\tmessage(FATAL_ERROR \u0022Install dbus-devel, or libdbus-1-dev etc\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_LIB)\n-\t\tset(LWS_DBUS_LIB \u0022dbus-1\u0022)\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE1)\n-\t\t# look in fedora and debian / ubuntu place\n-\t\tif (EXISTS \u0022/usr/include/dbus-1.0\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE1 \u0022/usr/include/dbus-1.0\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE1 to /usr/include/dbus-1.0 or wherever the main dbus includes are\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tif (NOT LWS_DBUS_INCLUDE2)\n-\t\t# look in fedora... debian / ubuntu has the ARCH in the path...\n-\t\tif (EXISTS \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\t\tset(LWS_DBUS_INCLUDE2 \u0022/usr/lib64/dbus-1.0/include\u0022)\n-\t\telse()\n-\t\t\tmessage(FATAL_ERROR \u0022Set LWS_DBUS_INCLUDE2 to /usr/lib/ARCH-linux-gnu/dbus-1.0/include or wherever dbus-arch-deps.h is on your system\u0022)\n-\t\tendif()\n-\tendif()\n-\n-\tset(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES};${LWS_DBUS_INCLUDE1};${LWS_DBUS_INCLUDE2})\n-\n-\tif (NOT LWS_DBUS_INCLUDE1 OR NOT LWS_DBUS_INCLUDE2)\n-\t\tmessage(FATAL_ERROR \u0022To build with libdbus, LWS_DBUS_INCLUDE1/2 must be given. See lib/roles/dbus/README.md\u0022)\n-\tendif()\n-\n-endif()\n-\n # If we are being built as part of lws, confirm current build config supports\n # reqconfig, else skip building ourselves.\n #\n@@ -110,9 +74,14 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n \n+\tif (NOT LWS_PLAT_FREERTOS)\n+\t\tfind_package(PkgConfig QUIET)\n+\t\tpkg_check_modules(PC_DBUS1 dbus-1 QUIET)\n+\t\tlist(APPEND LWS_DBUS_INCLUDE1 ${PC_DBUS1_INCLUDE_DIRS})\n+\t\tlist(APPEND LWS_DBUS_LIB \u0022${PC_DBUS1_LIBRARIES};dl\u0022)\n+\tendif()\n+\n \tinclude_directories(\u0022${LWS_DBUS_INCLUDE1}\u0022)\n-\tinclude_directories(\u0022${LWS_DBUS_INCLUDE2}\u0022)\n-\tlist(APPEND LIB_LIST dbus-1)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt\nindex 4b31f9d..fe19521 100644\n--- a/minimal-examples/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt\n@@ -70,6 +70,15 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n+\tif (LWS_CTEST_INTERNET_AVAILABLE)\n+\t\tadd_test(NAME http-client-h2-rxflow-warmcat COMMAND lws-minimal-http-client-h2-rxflow --ignore-sigterm)\n+\t\tadd_test(NAME http-client-h2-rxflow-warmcat-h1 COMMAND lws-minimal-http-client-h2-rxflow --ignore-sigterm --h1)\n+\t\tset_tests_properties(http-client-h2-rxflow-warmcat\n+\t\t\t\t http-client-h2-rxflow-warmcat-h1\n+\t\t\t\t PROPERTIES\n+\t\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-h2-rxflow\n+\t\t\t\t TIMEOUT 30)\n+\tendif()\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/http-client/minimal-http-client-h2-rxflow/selftest.sh b/minimal-examples/http-client/minimal-http-client-h2-rxflow/selftest.sh\ndeleted file mode 100755\nindex c065b44..0000000\n--- a/minimal-examples/http-client/minimal-http-client-h2-rxflow/selftest.sh\n+++ /dev/null\n@@ -1,33 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d4\n-\n-dotest $1 $2 warmcat\n-dotest $1 $2 warmcat-h1 --h1\n-\n-spawn \u0022\u0022 $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost -l\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-h1 -l --h1\n-\n-kill $SPID 2\u003e/dev/null\n-wait $SPID 2\u003e/dev/null\n-exit $FAILS\ndiff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt\nindex b36eae4..d2f7415 100644\n--- a/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt\n@@ -70,6 +70,17 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n \n+\tif (LWS_CTEST_INTERNET_AVAILABLE)\n+\t\tadd_test(NAME http-client-hugeurl-warmcat COMMAND lws-minimal-http-client-hugeurl --ignore-sigterm)\n+\t\tadd_test(NAME http-client-hugeurl-warmcat-h1 COMMAND lws-minimal-http-client-hugeurl --ignore-sigterm --h1)\n+\t\tset_tests_properties(http-client-hugeurl-warmcat\n+\t\t\t\t http-client-hugeurl-warmcat-h1\n+\t\t\t\t PROPERTIES\n+\t\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-hugeurl\n+\t\t\t\t TIMEOUT 20)\n+\n+\tendif()\n+\n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\n \t\tadd_dependencies(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c b/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c\nindex 6178396..f0b90a2 100644\n--- a/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c\n+++ b/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c\n@@ -149,23 +149,15 @@ int main(int argc, const char **argv)\n \tstruct lws_context_creation_info info;\n \tstruct lws_client_connect_info i;\n \tstruct lws_context *context;\n-\tconst char *p;\n-\tint n \u003d 0, logs \u003d LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE\n-\t\t\t/* for LLL_ verbosity above NOTICE to be built into lws,\n-\t\t\t * lws must have been configured and built with\n-\t\t\t * -DCMAKE_BUILD_TYPE\u003dDEBUG instead of \u003dRELEASE */\n-\t\t\t/* | LLL_INFO */ /* | LLL_PARSER */ /* | LLL_HEADER */\n-\t\t\t/* | LLL_EXT */ /* | LLL_CLIENT */ /* | LLL_LATENCY */\n-\t\t\t/* | LLL_DEBUG */;\n-\n-\tif ((p \u003d lws_cmdline_option(argc, argv, \u0022-d\u0022)))\n-\t\tlogs \u003d atoi(p);\n+\tint n \u003d 0;\n \n \tsignal(SIGINT, sigint_handler);\n-\tlws_set_log_level(logs, NULL);\n-\tlwsl_user(\u0022LWS minimal http client hugeurl [-d \u003cverbosity\u003e] [-l] [--h1]\u005cn\u0022);\n \n \tmemset(\u0026info, 0, sizeof info); /* otherwise uninitialized garbage */\n+\tlws_cmdline_option_handle_builtin(argc, argv, \u0026info);\n+\n+\tlwsl_user(\u0022LWS minimal http client hugeurl [-d \u003cverbosity\u003e] [-l] [--h1]\u005cn\u0022);\n+\n \tinfo.options \u003d LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;\n \tinfo.port \u003d CONTEXT_PORT_NO_LISTEN; /* we do not run any server */\n \tinfo.protocols \u003d protocols;\ndiff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/selftest.sh b/minimal-examples/http-client/minimal-http-client-hugeurl/selftest.sh\ndeleted file mode 100755\nindex 2da54b6..0000000\n--- a/minimal-examples/http-client/minimal-http-client-hugeurl/selftest.sh\n+++ /dev/null\n@@ -1,47 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d6\n-\n-dotest $1 $2 warmcat\n-dotest $1 $2 warmcat-h1 --h1\n-\n-spawn \u0022\u0022 $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost -l\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-h1 -l --h1\n-kill $SPID 2\u003e/dev/null\n-wait $SPID 2\u003e/dev/null\n-\n-\n-if [ -z \u0022$TRAVIS_OS_NAME\u0022 ] ; then\n-\tSPID\u003d\u0022\u0022\n-\tspawn \u0022\u0022 $5/http-server/minimal-http-server-eventlib $1/lws-minimal-http-server-eventlib --uv -s\n-\tdotest $1 $2 localhost-suv -l\n-\tspawn $SPID $5/http-server/minimal-http-server-eventlib $1/lws-minimal-http-server-eventlib --uv -s\n-\tdotest $1 $2 localhost-suv-h1 -l --h1\n-\n-\tkill $SPID 2\u003e/dev/null\n-\twait $SPID 2\u003e/dev/null\n-fi\n-\n-exit $FAILS\n-\n-\ndiff --git a/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt\nindex 2f9c305..6846684 100644\n--- a/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt\n@@ -70,6 +70,154 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n+\t\n+ #\n+ # instantiate the server per sai builder instance, they are running in the same\n+ # machine context in parallel so they can tread on each other otherwise\n+ #\n+ set(PORT_HCM_SRV \u00227670\u0022)\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00220\u0022)\n+ set(PORT_HCM_SRV 7671)\n+ endif()\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00221\u0022)\n+ set(PORT_HCM_SRV 7672)\n+ endif()\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00222\u0022)\n+ set(PORT_HCM_SRV 7673)\n+ endif()\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00223\u0022)\n+ set(PORT_HCM_SRV 7674)\n+ endif()\n+\n+\n+# hack\n+if (NOT WIN32 AND LWS_WITH_SERVER)\n+\n+\t#\n+\t# Tests against built server running locally (needs daemonization...)\n+\t#\n+\n+if (WIN32)\n+\tadd_test(NAME st_hcm_srv COMMAND cmd.exe /c start /b $\u003cTARGET_FILE:lws-minimal-http-server-tls\u003e --port ${PORT_HCM_SRV})\n+\tadd_test(NAME ki_hcm_srv COMMAND taskkill /F /IM $\u003cTARGET_FILE_NAME:lws-minimal-http-server-tls\u003e /T)\n+\tadd_test(NAME st_hcmp_srv COMMAND cmd.exe /c start /b $\u003cTARGET_FILE:test-server\u003e -s --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME ki_hcmp_srv COMMAND taskkill /F /IM $\u003cTARGET_FILE_NAME:test-server\u003e /T)\n+else()\n+\tadd_test(NAME st_hcm_srv COMMAND\n+\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh\n+\t\t\thcm_srv $\u003cTARGET_FILE:lws-minimal-http-server-tls\u003e\n+\t\t\t--port ${PORT_HCM_SRV})\n+\tadd_test(NAME ki_hcm_srv COMMAND\n+\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh\n+\t\t\thcm_srv $\u003cTARGET_FILE_NAME:lws-minimal-http-server-tls\u003e\n+\t\t\t\t--port ${PORT_HCM_SRV})\n+\tadd_test(NAME st_hcmp_srv COMMAND\n+\t\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh\n+\t\t\t\thcmp_srv $\u003cTARGET_FILE:test-server\u003e -s\n+\t\t\t\t-r ${CMAKE_SOURCE_DIR}/destdir/usr/local/share/libwebsockets-test-server/\n+\t\t\t\t--port 1${PORT_HCM_SRV})\n+\tadd_test(NAME ki_hcmp_srv COMMAND\n+\t\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh\n+\t\t\t\thcmp_srv $\u003cTARGET_FILE_NAME:test-server\u003e\n+\t\t\t\t--port 1${PORT_HCM_SRV})\n+endif()\n+\n+\tset_tests_properties(st_hcm_srv PROPERTIES\n+ \t\tWORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-tls\n+\t\tFIXTURES_SETUP hcm_srv\n+\t\tTIMEOUT 800)\n+\tset_tests_properties(ki_hcm_srv PROPERTIES\n+\t\tFIXTURES_CLEANUP hcm_srv)\n+\n+\tset_tests_properties(st_hcmp_srv PROPERTIES\n+ \t\tWORKING_DIRECTORY .\n+\t\tFIXTURES_SETUP hcmp_srv\n+\t\tTIMEOUT 800)\n+\tset_tests_properties(ki_hcmp_srv PROPERTIES\n+\t\tFIXTURES_CLEANUP hcmp_srv)\n+\n+\t#\n+\t# Tests against local server peer\n+\t#\n+\n+\tadd_test(NAME http-client-multi COMMAND lws-minimal-http-client-multi\n+\t\t\t-l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-h1 COMMAND lws-minimal-http-client-multi\n+\t\t\t--h1 -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t-p -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-h1-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t--h1 -p -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-stag COMMAND lws-minimal-http-client-multi\n+\t\t\t-s -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-stag-h1 COMMAND lws-minimal-http-client-multi\n+\t\t\t--h1 -s -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-stag-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t-p -s -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-stag-h1-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t--h1 -p -s -l --port ${PORT_HCM_SRV})\n+\n+\t# confirm that the pipelined mode really is doing it in one connection\n+\tadd_test(NAME http-client-multi-restrict-pipe COMMAND lws-minimal-http-client-multi -d1151 --limit 1 -p -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-restrict-h1-pipe COMMAND lws-minimal-http-client-multi -d1151 --limit 1 --h1 -p -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-restrict-stag-pipe COMMAND lws-minimal-http-client-multi -d1151 --limit 1 -p -s -l --port ${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-restrict-stag-h1-pipe COMMAND lws-minimal-http-client-multi -d1151 --limit 1 --h1 -p -s -l --port ${PORT_HCM_SRV})\n+\t# confirm that we do fail with a one connection limit and no pipelining\n+\tadd_test(NAME http-client-multi-restrict-nopipe-fail COMMAND lws-minimal-http-client-multi --limit 1 -l --port ${PORT_HCM_SRV})\n+\tset_property(TEST http-client-multi-restrict-nopipe-fail PROPERTY WILL_FAIL TRUE)\n+\tadd_test(NAME http-client-multi-restrict-h1-nopipe-fail COMMAND lws-minimal-http-client-multi --limit 1 --h1 -l --port ${PORT_HCM_SRV})\n+\tset_property(TEST http-client-multi-restrict-h1-nopipe-fail PROPERTY WILL_FAIL TRUE)\n+\n+\tset_tests_properties(http-client-multi-restrict-pipe\n+\t\t\t http-client-multi-restrict-h1-pipe\n+\t\t\t http-client-multi-restrict-stag-pipe\n+\t\t\t http-client-multi-restrict-stag-h1-pipe\n+\t\t\t http-client-multi-restrict-nopipe-fail\n+\t\t\t http-client-multi-restrict-h1-nopipe-fail\n+\t\t\t http-client-multi\n+\t\t\t http-client-multi-h1\n+\t\t\t http-client-multi-pipe\n+\t\t\t http-client-multi-h1-pipe\n+\t\t\t http-client-multi-stag\n+\t\t\t http-client-multi-stag-h1\n+\t\t\t http-client-multi-stag-pipe\n+\t\t\t http-client-multi-stag-h1-pipe\n+\t\t\t PROPERTIES\n+\t\t\t FIXTURES_REQUIRED \u0022hcm_srv\u0022\n+\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-multi\n+\t\t\t TIMEOUT 20)\n+\n+\t# POSTs against local http-server-form-post\n+\tadd_test(NAME http-client-multi-post COMMAND lws-minimal-http-client-multi\n+\t\t\t--post -l --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-post-h1 COMMAND lws-minimal-http-client-multi\n+\t\t\t--post --h1 -l --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-post-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t--post -p -l --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-post-h1-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t--post --h1 -p -l --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-post-stag COMMAND lws-minimal-http-client-multi\n+\t\t\t--post -s -l -d1151 --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-post-stag-h1 COMMAND lws-minimal-http-client-multi\n+\t\t\t--post --h1 -d1151 -s -l --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-post-stag-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t--post -p -s -l --port 1${PORT_HCM_SRV})\n+\tadd_test(NAME http-client-multi-post-stag-h1-pipe COMMAND lws-minimal-http-client-multi\n+\t\t\t--post --h1 -p -s -l --port 1${PORT_HCM_SRV})\n+\tset_tests_properties(http-client-multi-post\n+\t\t\t http-client-multi-post-h1\n+\t\t\t http-client-multi-post-pipe\n+\t\t\t http-client-multi-post-h1-pipe\n+\t\t\t http-client-multi-post-stag\n+\t\t\t http-client-multi-post-stag-h1\n+\t\t\t http-client-multi-post-stag-pipe\n+\t\t\t http-client-multi-post-stag-h1-pipe\n+\t\t\t PROPERTIES\n+\t\t\t \tFIXTURES_REQUIRED \u0022hcmp_srv\u0022\n+\t\t\t \tWORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-multi\n+\t\t\t \tTIMEOUT 20)\n+\n+endif(NOT WIN32 AND LWS_WITH_SERVER)\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c\nindex caca20b..99bb629 100644\n--- a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c\n+++ b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c\n@@ -132,7 +132,9 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason,\n \t\t\tbreak;\n \t\tif (lws_http_is_redirected_to_get(wsi))\n \t\t\tbreak;\n-\t\tlwsl_user(\u0022LWS_CALLBACK_CLIENT_HTTP_WRITEABLE: %p, part %d\u005cn\u0022, wsi, pss-\u003ebody_part);\n+\t\tlwsl_info(\u0022LWS_CALLBACK_CLIENT_HTTP_WRITEABLE: %p, idx %d,\u0022\n+\t\t\t\t\u0022 part %d\u005cn\u0022, wsi, idx, pss-\u003ebody_part);\n+\n \t\tn \u003d LWS_WRITE_HTTP;\n \n \t\t/*\n@@ -318,18 +320,14 @@ int main(int argc, const char **argv)\n {\n \tstruct lws_context_creation_info info;\n \tunsigned long long start;\n+\tint m, staggered \u003d 0;\n \tconst char *p;\n-\tint m, staggered \u003d 0, logs \u003d LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE\n-\t\t/* for LLL_ verbosity above NOTICE to be built into lws,\n-\t\t * lws must have been configured and built with\n-\t\t * -DCMAKE_BUILD_TYPE\u003dDEBUG instead of \u003dRELEASE */\n-\t\t/* | LLL_INFO */ /* | LLL_PARSER */ /* | LLL_HEADER */\n-\t\t/* | LLL_EXT */ /* | LLL_CLIENT */ /* | LLL_LATENCY */\n-\t\t/* | LLL_DEBUG */;\n \n \tmemset(\u0026info, 0, sizeof info); /* otherwise uninitialized garbage */\n \tmemset(\u0026i, 0, sizeof i); /* otherwise uninitialized garbage */\n \n+\tlws_cmdline_option_handle_builtin(argc, argv, \u0026info);\n+\n \tinfo.signal_cb \u003d signal_cb;\n \tinfo.options \u003d LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;\n \n@@ -348,10 +346,7 @@ int main(int argc, const char **argv)\n \t\t\t\t\tsignal(SIGINT, sigint_handler);\n \n \tstaggered \u003d !!lws_cmdline_option(argc, argv, \u0022-s\u0022);\n-\tif ((p \u003d lws_cmdline_option(argc, argv, \u0022-d\u0022)))\n-\t\tlogs \u003d atoi(p);\n \n-\tlws_set_log_level(logs, NULL);\n \tlwsl_user(\u0022LWS minimal http client [-s (staggered)] [-p (pipeline)]\u005cn\u0022);\n \tlwsl_user(\u0022 [--h1 (http/1 only)] [-l (localhost)] [-d \u003clogs\u003e]\u005cn\u0022);\n \tlwsl_user(\u0022 [-n (numbered)] [--post]\u005cn\u0022);\n@@ -424,6 +419,9 @@ int main(int argc, const char **argv)\n \t\t\tstrcpy(urlpath, \u0022/testserver/formtest\u0022);\n \t}\n \n+\tif (lws_cmdline_option(argc, argv, \u0022--no-tls\u0022))\n+\t\ti.ssl_connection \u0026\u003d ~(LCCSCF_USE_SSL);\n+\n \tif (lws_cmdline_option(argc, argv, \u0022-n\u0022))\n \t\tnumbered \u003d 1;\n \ndiff --git a/minimal-examples/http-client/minimal-http-client-multi/selftest.sh b/minimal-examples/http-client/minimal-http-client-multi/selftest.sh\ndeleted file mode 100755\nindex 3140fda..0000000\n--- a/minimal-examples/http-client/minimal-http-client-multi/selftest.sh\n+++ /dev/null\n@@ -1,66 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d30\n-\n-dotest $1 $2 warmcat\n-dotest $1 $2 warmcat-pipe -p\n-dotest $1 $2 warmcat-h1 --h1\n-dotest $1 $2 warmcat-h1-pipe --h1 -p\n-dotest $1 $2 warmcat-stag -s\n-dotest $1 $2 warmcat-pipe-stag -p -s\n-dotest $1 $2 warmcat-h1-stag --h1 -s\n-dotest $1 $2 warmcat-h1-pipe-stag --h1 -p -s\n-dotest $1 $2 warmcat-post --post\n-dotest $1 $2 warmcat-post-pipe --post -p\n-dotest $1 $2 warmcat-post-pipe-stag --post -p -s\n-dotest $1 $2 warmcat-h1-post --post --h1\n-dotest $1 $2 warmcat-h1-post-pipe --post --h1 -p\n-dotest $1 $2 warmcat-h1-post-pipe-stag --post --h1 -p -s\n-dotest $1 $2 warmcat-restrict-pipe --limit 1 -p\n-dotest $1 $2 warmcat-restrict-h1-pipe --limit 1 -p --h1\n-dotest $1 $2 warmcat-restrict-pipe-stag --limit 1 -p -s\n-dotest $1 $2 warmcat-restrict-h1-pipe-stag --limit 1 -p --h1 -s\n-dofailtest $1 $2 fail-warmcat-restrict --limit 1 \n-dofailtest $1 $2 fail-warmcat-restrict-h1 --limit 1 --h1\n-dofailtest $1 $2 fail-warmcat-restrict-stag --limit 1 -s\n-dofailtest $1 $2 fail-warmcat-restrict-h1-stag --limit 1 --h1 -s\n-\n-spawn \u0022\u0022 $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost -l\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-pipe -l -p\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-h1 -l --h1\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-h1-pipe -l --h1 -p\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-stag -l -s\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-pipe-stag -l -p -s\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-h1-stag -l --h1 -s\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-h1-pipe-stag -l --h1 -p -s\n-\n-kill $SPID 2\u003e/dev/null\n-wait $SPID 2\u003e/dev/null\n-exit $FAILS\n-\ndiff --git a/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt\nindex 9c5780f..f83182f 100644\n--- a/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt\n@@ -69,6 +69,72 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n+\t\n+\t#\n+\t# instantiate the server per sai builder instance, they are running in the same\n+\t# machine context in parallel so they can tread on each other otherwise\n+\t#\n+\tset(PORT_HCP_SRV \u00227640\u0022)\n+\tif (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00220\u0022)\n+\t\tset(PORT_HCP_SRV 7641)\n+\tendif()\n+\tif (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00221\u0022)\n+\t\tset(PORT_HCP_SRV 7642)\n+\tendif()\n+\tif (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00222\u0022)\n+\t\tset(PORT_HCP_SRV 7643)\n+\tendif()\n+\tif (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00223\u0022)\n+\t\tset(PORT_HCP_SRV 7644)\n+\tendif()\n+\t\n+# hack\n+if (NOT WIN32 AND LWS_WITH_SERVER)\n+\n+\t#\n+\t# Tests against built server running locally (needs daemonization...)\n+\t#\n+\n+if (WIN32)\n+\tadd_test(NAME st_hcp_srv COMMAND cmd.exe /c start /b $\u003cTARGET_FILE:test-server\u003e -s --port ${PORT_HCP_SRV})\n+\tadd_test(NAME ki_hcp_srv COMMAND taskkill /F /IM $\u003cTARGET_FILE_NAME:test-server\u003e /T)\n+else()\n+\tadd_test(NAME st_hcp_srv COMMAND\n+\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh\n+\t\t\t\thcp_srv\n+\t\t\t\t$\u003cTARGET_FILE:test-server\u003e\n+\t\t\t\t-r ${CMAKE_SOURCE_DIR}/destdir/usr/local/share/libwebsockets-test-server/\n+\t\t\t\t-s --port ${PORT_HCP_SRV})\n+\tadd_test(NAME ki_hcp_srv COMMAND\n+\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh hcp_srv\n+\t\t\t\t$\u003cTARGET_FILE_NAME:test-server\u003e --port ${PORT_HCP_SRV})\n+endif()\n+\n+\tset_tests_properties(st_hcp_srv PROPERTIES\n+\t\t\t\t\t WORKING_DIRECTORY .\n+\t\t\t\t\t FIXTURES_SETUP hcp_srv\n+\t\t\t\t\t TIMEOUT 800)\n+\tset_tests_properties(ki_hcp_srv PROPERTIES\n+\t\t\t\t\t FIXTURES_CLEANUP hcp_srv)\n+\n+\tadd_test(NAME http-client-post COMMAND\n+\t\tlws-minimal-http-client-post -l --port ${PORT_HCP_SRV})\n+\tadd_test(NAME http-client-post-m COMMAND\n+\t\tlws-minimal-http-client-post -l -m --port ${PORT_HCP_SRV})\n+\tadd_test(NAME http-client-post-h1 COMMAND\n+\t\tlws-minimal-http-client-post -l --h1 --port ${PORT_HCP_SRV})\n+\tadd_test(NAME http-client-post-m-h1 COMMAND\n+\t\tlws-minimal-http-client-post -l -m --h1 --port ${PORT_HCP_SRV})\n+\tset_tests_properties(http-client-post\n+\t\t\t http-client-post-m\n+\t\t\t http-client-post-h1\n+\t\t\t http-client-post-m-h1\n+\t\t\t PROPERTIES\n+\t\t\t FIXTURES_REQUIRED \u0022hcp_srv\u0022\n+\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-post\n+\t\t\t TIMEOUT 20)\n+endif()\n+\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\ndiff --git a/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c b/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c\nindex b291efb..6a8cc5d 100644\n--- a/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c\n+++ b/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c\n@@ -189,6 +189,7 @@ int main(int argc, const char **argv)\n \tstruct lws_context_creation_info info;\n \tstruct lws_client_connect_info i;\n \tstruct lws_context *context;\n+\tconst char *p;\n \tint n \u003d 0;\n \n \tsignal(SIGINT, sigint_handler);\n@@ -245,6 +246,9 @@ int main(int argc, const char **argv)\n \tif (lws_cmdline_option(argc, argv, \u0022--form1\u0022))\n \t\ti.path \u003d \u0022/form1\u0022;\n \n+\tif ((p \u003d lws_cmdline_option(argc, argv, \u0022--port\u0022)))\n+\t\ti.port \u003d atoi(p);\n+\n \ti.host \u003d i.address;\n \ti.origin \u003d i.address;\n \ti.method \u003d \u0022POST\u0022;\n@@ -257,6 +261,8 @@ int main(int argc, const char **argv)\n \n \tfor (n \u003d 0; n \u003c count_clients; n++) {\n \t\ti.pwsi \u003d \u0026client_wsi[n];\n+\t\tlwsl_notice(\u0022%s: connecting to %s:%d\u005cn\u0022, __func__,\n+\t\t\t i.address, i.port);\n \t\tif (!lws_client_connect_via_info(\u0026i))\n \t\t\tcompleted++;\n \t}\ndiff --git a/minimal-examples/http-client/minimal-http-client-post/selftest.sh b/minimal-examples/http-client/minimal-http-client-post/selftest.sh\ndeleted file mode 100755\nindex 8d3476f..0000000\n--- a/minimal-examples/http-client/minimal-http-client-post/selftest.sh\n+++ /dev/null\n@@ -1,39 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d8\n-\n-dotest $1 $2 warmcat\n-dotest $1 $2 warmcat-h1 --h1\n-dotest $1 $2 warmcat-m -m\n-dotest $1 $2 warmcat-m-h1 -m --h1\n-\n-spawn \u0022\u0022 $5 $1/libwebsockets-test-server -s\n-dotest $1 $2 localhost -l -d1151\n-spawn $SPID $5 $1/libwebsockets-test-server -s\n-dotest $1 $2 localhost-h1 -l --h1\n-spawn $SPID $5 $1/libwebsockets-test-server -s\n-dotest $1 $2 localhost-m -l -m\n-spawn $SPID $5 $1/libwebsockets-test-server -s\n-dotest $1 $2 localhost-m-h1 -l -m --h1\n-\n-kill $SPID 2\u003e/dev/null\n-wait $SPID 2\u003e/dev/null\n-exit $FAILS\ndiff --git a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client/CMakeLists.txt\nindex be0d758..6dd0ba0 100644\n--- a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client/CMakeLists.txt\n@@ -71,10 +71,21 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n \n+\t#\tif (LWS_CTEST_INTERNET_AVAILABLE)\n+\t#\tadd_test(NAME http-client-warmcat COMMAND lws-minimal-http-client --ignore-sigterm)\n+\t#\tadd_test(NAME http-client-warmcat-h1 COMMAND lws-minimal-http-client --ignore-sigterm --h1)\n+\t#\tset_tests_properties(http-client-warmcat\n+\t#\t\t\t http-client-warmcat-h1\n+\t#\t\t\t PROPERTIES\n+\t#\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client\n+\t#\t\t\t TIMEOUT 20)\n+\t#\n+\t#endif()\n+\n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\n \t\tadd_dependencies(${SAMP} websockets_shared)\n \telse()\n \t\ttarget_link_libraries(${SAMP} websockets)\n \tendif()\n-endif()\n\u005c No newline at end of file\n+endif()\ndiff --git a/minimal-examples/http-client/minimal-http-client/selftest.sh b/minimal-examples/http-client/minimal-http-client/selftest.sh\ndeleted file mode 100755\nindex c065b44..0000000\n--- a/minimal-examples/http-client/minimal-http-client/selftest.sh\n+++ /dev/null\n@@ -1,33 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d4\n-\n-dotest $1 $2 warmcat\n-dotest $1 $2 warmcat-h1 --h1\n-\n-spawn \u0022\u0022 $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost -l\n-spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls\n-dotest $1 $2 localhost-h1 -l --h1\n-\n-kill $SPID 2\u003e/dev/null\n-wait $SPID 2\u003e/dev/null\n-exit $FAILS\ndiff --git a/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c b/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c\nindex 4711fc2..edc55bc 100644\n--- a/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c\n+++ b/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c\n@@ -202,6 +202,9 @@ int main(int argc, const char **argv)\n \t\tinfo.ssl_private_key_filepath \u003d \u0022localhost-100y.key\u0022;\n \t}\n \n+\tif ((p \u003d lws_cmdline_option(argc, argv, \u0022--port\u0022)))\n+\t\tinfo.port \u003d atoi(p);\n+\n \tif (lws_cmdline_option(argc, argv, \u0022--303\u0022)) {\n \t\tlwsl_user(\u0022%s: using 303 redirect\u005cn\u0022, __func__);\n \t\tuse303 \u003d 1;\ndiff --git a/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c b/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c\nindex 3cda698..cb8c313 100644\n--- a/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c\n+++ b/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c\n@@ -52,24 +52,17 @@ int main(int argc, const char **argv)\n \tstruct lws_context_creation_info info;\n \tstruct lws_context *context;\n \tconst char *p;\n-\tint n \u003d 0, logs \u003d LLL_USER | LLL_ERR | LLL_WARN | LLL_NOTICE\n-\t\t\t/* for LLL_ verbosity above NOTICE to be built into lws,\n-\t\t\t * lws must have been configured and built with\n-\t\t\t * -DCMAKE_BUILD_TYPE\u003dDEBUG instead of \u003dRELEASE */\n-\t\t\t/* | LLL_INFO */ /* | LLL_PARSER */ /* | LLL_HEADER */\n-\t\t\t/* | LLL_EXT */ /* | LLL_CLIENT */ /* | LLL_LATENCY */\n-\t\t\t/* | LLL_DEBUG */;\n-\n-\tif ((p \u003d lws_cmdline_option(argc, argv, \u0022-d\u0022)))\n-\t\tlogs \u003d atoi(p);\n-\n-\tlws_set_log_level(logs, NULL);\n-\tlwsl_user(\u0022LWS minimal http server TLS | visit https://localhost:7681\u005cn\u0022);\n+\tint n \u003d 0;\n \n \tsignal(SIGINT, sigint_handler);\n \n \tmemset(\u0026info, 0, sizeof info); /* otherwise uninitialized garbage */\n+\tlws_cmdline_option_handle_builtin(argc, argv, \u0026info);\n+\tlwsl_user(\u0022LWS minimal http server TLS | visit https://localhost:7681\u005cn\u0022);\n+\n \tinfo.port \u003d 7681;\n+\tif ((p \u003d lws_cmdline_option(argc, argv, \u0022--port\u0022)))\n+\t\tinfo.port \u003d atoi(p);\n \tinfo.mounts \u003d \u0026mount;\n \tinfo.error_document_404 \u003d \u0022/404.html\u0022;\n \tinfo.options \u003d LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT |\ndiff --git a/minimal-examples/selftests-library.sh b/minimal-examples/selftests-library.sh\ndeleted file mode 100755\nindex 01cbbd8..0000000\n--- a/minimal-examples/selftests-library.sh\n+++ /dev/null\n@@ -1,110 +0,0 @@\n-#!/bin/bash\n-\n-if [ -z \u0022$1\u0022 -o -z \u0022$2\u0022 ] ; then\n-\techo \u0022required args missing\u0022\n-\texit 1\n-fi\n-\n-IDX\u003d$3\n-TOT\u003d$4\n-MYTEST\u003d`echo $0 | sed \u0022s/\u005c/[^\u005c/]*\u005c$//g\u0022 |sed \u0022s/.*\u005c///g\u0022`\n-mkdir -p $2/$MYTEST\n-rm -f $2/$MYTEST/*.log $2/$MYTEST/*.result\n-FAILS\u003d0\n-WHICH\u003d$IDX\n-SPID\u003d\n-SCRIPT_DIR\u003d`dirname $0`\n-SCRIPT_DIR\u003d`readlink -f $SCRIPT_DIR`\n-LOGPATH\u003d$2\n-\n-feedback() {\n-\tif [ \u0022$2\u0022 !\u003d \u0022$4\u0022 ] ; then\n-\t\tFAILS\u003d$(( $FAILS + 1 ))\n-\t\techo -n -e \u0022\u005ce[31m\u0022\n-\tfi\n-\tT\u003d\u0022 --- killed --- \u0022\n-\tif [ ! -z \u0022`cat $LOGPATH/$MYTEST/$3.time`\u0022 ] ; then\n-\t\tT\u003d\u0022`cat $LOGPATH/$MYTEST/$3.time | grep real | sed \u0022s/.*\u005c //g\u0022`\u0022\n-\t\tT\u003d\u0022$T `cat $LOGPATH/$MYTEST/$3.time | grep user | sed \u0022s/.*\u005c //g\u0022`\u0022\n-\t\tT\u003d\u0022$T `cat $LOGPATH/$MYTEST/$3.time | grep sys | sed \u0022s/.*\u005c //g\u0022`\u0022\n-\tfi\n-\tprintf \u0022%-35s [ %3s/%3s ]: %3s : %8s : %s\u005cn\u0022 $1 $WHICH $TOT $2 \u0022$T\u0022 $3\n-\tif [ \u0022$2\u0022 !\u003d \u00220\u0022 ] ; then\n-\t\techo -n -e \u0022\u005ce[0m\u0022\n-\tfi\n-\tWHICH\u003d$(( $WHICH + 1))\n-}\n-\n-spawn() {\n-\tif [ ! -z \u0022$1\u0022 ] ; then\n-\t\tif [ `ps $1 | wc -l` -eq 2 ]; then\n-#\t\t\techo \u0022prerequisite still up\u0022\n-\t\t\treturn 0\n-\t\tfi\n-\tfi\n-\n-\tQQ\u003d`pwd`\n-\tcd $SCRIPT_DIR\n-\tcd $2\n-\t$3 $4 $5 \u003e $LOGPATH/$MYTEST/serverside.log 2\u003e $LOGPATH/$MYTEST/serverside.log \u0026\n-\tSPID\u003d$!\n-\tcd $QQ\n-\tsleep 0.5s\n-#\techo \u0022launched prerequisite $SPID\u0022\n-}\n-\n-_dotest() {\n-\tEXPRES\u003d0\n-\tif [ ! -z \u0022$4\u0022 ] ; then\n-\t\tEXPRES\u003d$4\n-\tfi\n-\tT\u003d$3\n-#\techo \u0022$1/lws-$MYTEST $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14}\u0022\n-\t(\n-\t\t{\n-\t\t\t/usr/bin/time -p /usr/bin/valgrind -q $1/lws-$MYTEST $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13} ${14} \u003e $2/$MYTEST/$T.log 2\u003e $2/$MYTEST/$T.log ;\n-\t\t\techo $? \u003e $2/$MYTEST/$T.result\n-\t\t} 2\u003e $2/$MYTEST/$T.time \u003e/dev/null\n-\t) \u003e/dev/null 2\u003e /dev/null \u0026\n-\tW\u003d$!\n-\tWT\u003d0\n-\twhile [ $WT -le 820 ] ; do\n-\t\tkill -0 $W 2\u003e/dev/null\n-\t\tif [ $? -ne 0 ] ; then\n-\t\t\tWT\u003d10000\n-\t\telse\n-\t\t\tif [ $WT -ge 800 ] ; then\n-\t\t\t\tWT\u003d10000\n-\t\t\t\tkill $W 2\u003e/dev/null\n-\t\t\t\twait $W 2\u003e/dev/null\n-\t\t\tfi\n-\t\tfi\n-\t\tsleep 0.1s\n-\t\tWT\u003d$(( $WT + 1 ))\n-\tdone\n-\n-\tR\u003d254\n-\tif [ -e $2/$MYTEST/$T.result ] ; then\n-\t\tR\u003d`cat $2/$MYTEST/$T.result`\n-\t\tcat $2/$MYTEST/$T.log | tail -n 3 \u003e $2/$MYTEST/$T.time\n-\t\tif [ $R -ne $EXPRES ] ; then\n-\t\t\tpwd\n-\t\t\techo Expected result $EXPRES but got $R\n-\t\t\techo\n-\t\t\tcat $2/$MYTEST/$T.log\n-\t\t\techo\n-\t\tfi\n-\tfi\n-\n-\tfeedback $MYTEST $R $T $EXPRES\n-}\n-\n-dotest()\n-{\n-\t_dotest $1 $2 $3 0 \u0022$4\u0022 \u0022$5\u0022 \u0022$6\u0022 \u0022$7\u0022 \u0022$8\u0022 \u0022$9\u0022 \u0022${10}\u0022 \u0022${11}\u0022 \u0022${12}\u0022 \u0022${13}\u0022\n-}\n-\n-dofailtest()\n-{\n-\t_dotest $1 $2 $3 1 $4 $5 $6 $7 $8 $9 ${10} ${11} ${12} ${13}\n-}\ndiff --git a/minimal-examples/selftests.sh b/minimal-examples/selftests.sh\ndeleted file mode 100755\nindex 77fbdd4..0000000\n--- a/minimal-examples/selftests.sh\n+++ /dev/null\n@@ -1,61 +0,0 @@\n-#!/bin/bash\n-#\n-# run this from your build dir having configured\n-# -DLWS_WITH_MINIMAL_EXAMPLES\u003d1 to get all the examples\n-# that apply built into ./bin\n-#\n-# Eg,\n-#\n-# build $ ../minimal-examples/selftests.sh\n-\n-echo\n-echo \u0022----------------------------------------------\u0022\n-echo \u0022------- tests: lws minimal example selftests\u0022\n-echo\n-\n-LOGGING_PATH\u003d/tmp/logs\n-\n-# for mebedtls, we need the CA certs in ./build where we run from\n-\n-cp ../minimal-examples/http-client/minimal-http-client-multi/warmcat.com.cer .\n-cp ../minimal-examples/http-client/minimal-http-client-post/libwebsockets.org.cer .\n-\n-MINEX\u003d`dirname $0`\n-MINEX\u003d`realpath $MINEX`\n-TESTS\u003d0\n-for i in `find $MINEX -name selftest.sh` ; do\n-\tBN\u003d`echo -n \u0022$i\u0022 | sed \u0022s/\u005c/[^\u005c/]*\u005c$//g\u0022 | sed \u0022s/.*\u005c///g\u0022`\n-\tif [ -e `pwd`/bin/lws-$BN ] ; then\n-\t\tC\u003d`cat $i | grep COUNT_TESTS\u003d | cut -d\u003d -f2`\n-\t\tTESTS\u003d$(( $TESTS + $C ))\n-\tfi\n-done\n-\n-FAILS\u003d0\n-WH\u003d1\n-\n-for i in `find $MINEX -name selftest.sh` ; do\n-\tBN\u003d`echo -n \u0022$i\u0022 | sed \u0022s/\u005c/[^\u005c/]*\u005c$//g\u0022 | sed \u0022s/.*\u005c///g\u0022`\n-\tif [ -e `pwd`/bin/lws-$BN ] ; then\n-\t\tC\u003d`cat $i | grep COUNT_TESTS\u003d | cut -d\u003d -f2`\n-\t\tsh $i `pwd`/bin $LOGGING_PATH $WH $TESTS $MINEX\n-\t\tFAILS\u003d$(( $FAILS + $? ))\n-\t\n-\t\tL\u003d`ps fax | grep lws- | cut -d' ' -f2`\n-\t\tkill $L 2\u003e/dev/null\n-\t\tkill -9 $L 2\u003e/dev/null\n-\t\twait $L 2\u003e/dev/null\n-\t\n-\t\tWH\u003d$(( $WH + $C ))\n-\tfi\n-done\n-\n-if [ $FAILS -eq 0 ] ; then\n-\techo \u0022All $TESTS passed\u0022\n-\texit 0\n-else\n-\techo \u0022Failed: $FAILS / $TESTS\u0022\n-\texit 1\n-fi\n-\n-\ndiff --git a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt\nindex 31b5117..57bb3af 100644\n--- a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt\n+++ b/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt\n@@ -69,6 +69,14 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n+\tif (LWS_CTEST_INTERNET_AVAILABLE)\n+\t\tadd_test(NAME ws-client-rx-warmcat COMMAND lws-minimal-ws-client-rx -t)\n+\t\tset_tests_properties(ws-client-rx-warmcat\n+\t\t\t\t PROPERTIES\n+\t\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/ws-client/minimal-ws-client-rx\n+\t\t\t\t TIMEOUT 20)\n+\n+\tendif()\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared)\n@@ -76,4 +84,4 @@ if (requirements)\n \telse()\n \t\ttarget_link_libraries(${SAMP} websockets)\n \tendif()\n-endif()\n\u005c No newline at end of file\n+endif()\ndiff --git a/minimal-examples/ws-client/minimal-ws-client-rx/selftest.sh b/minimal-examples/ws-client/minimal-ws-client-rx/selftest.sh\ndeleted file mode 100644\nindex 070ef7f..0000000\n--- a/minimal-examples/ws-client/minimal-ws-client-rx/selftest.sh\n+++ /dev/null\n@@ -1,25 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 warmcat -t\n-\n-exit $FAILS\ndiff --git a/minimal-examples/ws-client/minimal-ws-client-spam/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-spam/CMakeLists.txt\nindex 42fd970..47850db 100644\n--- a/minimal-examples/ws-client/minimal-ws-client-spam/CMakeLists.txt\n+++ b/minimal-examples/ws-client/minimal-ws-client-spam/CMakeLists.txt\n@@ -89,6 +89,53 @@ require_lws_config(LWS_WITH_CLIENT 1 requirements)\n \n if (requirements)\n \tadd_executable(${SAMP} ${SRCS})\n+ #\n+ # instantiate the server per sai builder instance, they are running in the same\n+ # machine context in parallel so they can tread on each other otherwise\n+ #\n+ set(PORT_WCS_SRV \u00227620\u0022)\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00220\u0022)\n+\t set(PORT_WCS_SRV 7621)\n+ endif()\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00221\u0022)\n+\t set(PORT_WCS_SRV 7622)\n+ endif()\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00222\u0022)\n+\t set(PORT_WCS_SRV 7623)\n+ endif()\n+ if (\u0022$ENV{SAI_INSTANCE_IDX}\u0022 STREQUAL \u00223\u0022)\n+\t set(PORT_WCS_SRV 7624)\n+ endif()\n+\n+# hack\n+if (WIN32)\n+else()\n+\n+if (LWS_WITH_SERVER)\n+if (WIN32)\n+\tadd_test(NAME st_wcs_srv COMMAND cmd.exe /c start /b $\u003cTARGET_FILE:test-server\u003e -s --port ${PORT_WCS_SRV})\n+\tadd_test(NAME ki_wcs_srv COMMAND taskkill /F /IM $\u003cTARGET_FILE_NAME:test-server\u003e /T)\n+else()\n+\tadd_test(NAME st_wcs_srv COMMAND\n+\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh\n+\t\twcs_srv $\u003cTARGET_FILE:test-server\u003e\n+\t\t\t-r ${CMAKE_SOURCE_DIR}/destdir/usr/local/share/libwebsockets-test-server/\n+\t\t\t-s --port ${PORT_WCS_SRV})\n+\tadd_test(NAME ki_wcs_srv COMMAND\n+\t\t${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh\n+\t\twcs_srv $\u003cTARGET_FILE_NAME:test-server\u003e --port ${PORT_WCS_SRV})\n+endif()\n+\n+\tset_tests_properties(st_wcs_srv PROPERTIES WORKING_DIRECTORY . FIXTURES_SETUP wcs_srv TIMEOUT 800)\n+\tset_tests_properties(ki_wcs_srv PROPERTIES FIXTURES_CLEANUP wcs_srv)\n+\n+\tadd_test(NAME ws-client-spam COMMAND lws-minimal-ws-client-spam --server localhost --port ${PORT_WCS_SRV} -l 32 -c 3)\n+\tset_tests_properties(ws-client-spam PROPERTIES\n+\t\t\t WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/ws-client/minimal-ws-client-spam\n+\t\t\t FIXTURES_REQUIRED \u0022wcs_srv\u0022\n+\t\t\t TIMEOUT 40)\n+endif()\n+endif()\n \n \tif (websockets_shared)\n \t\ttarget_link_libraries(${SAMP} websockets_shared ${PTHREAD_LIB})\ndiff --git a/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c b/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c\nindex 3809ef5..080346e 100644\n--- a/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c\n+++ b/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c\n@@ -70,6 +70,7 @@ connect_client(int idx)\n \tclients[idx].state \u003d CLIENT_CONNECTING;\n \ttries++;\n \n+\tlwsl_notice(\u0022%s: connection %s:%d\u005cn\u0022, __func__, i.address, i.port);\n \tif (!lws_client_connect_via_info(\u0026i)) {\n \t\tclients[idx].wsi \u003d NULL;\n \t\tclients[idx].state \u003d CLIENT_IDLE;\n@@ -258,6 +259,8 @@ int main(int argc, const char **argv)\n \twhile (n \u003e\u003d 0 \u0026\u0026 !interrupted)\n \t\tn \u003d lws_service(context, 0);\n \n+\tlwsl_notice(\u0022%s: exiting service loop\u005cn\u0022, __func__);\n+\n \tlws_context_destroy(context);\n \n \tif (tries \u003d\u003d limit \u0026\u0026 closed \u003d\u003d tries) {\ndiff --git a/minimal-examples/ws-client/minimal-ws-client-spam/selftest.sh b/minimal-examples/ws-client/minimal-ws-client-spam/selftest.sh\ndeleted file mode 100755\nindex b9f2cde..0000000\n--- a/minimal-examples/ws-client/minimal-ws-client-spam/selftest.sh\n+++ /dev/null\n@@ -1,26 +0,0 @@\n-#!/bin/bash\n-#\n-# $1: path to minimal example binaries...\n-# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES\u003d1\n-# that will be ./bin from your build dir\n-#\n-# $2: path for logs and results. The results will go\n-# in a subdir named after the directory this script\n-# is in\n-#\n-# $3: offset for test index count\n-#\n-# $4: total test count\n-#\n-# $5: path to ./minimal-examples dir in lws\n-#\n-# Test return code 0: OK, 254: timed out, other: error indication\n-\n-. $5/selftests-library.sh\n-\n-COUNT_TESTS\u003d1\n-\n-dotest $1 $2 warmcat\n-\n-exit $FAILS\n-\ndiff --git a/plugins/protocol_lws_mirror.c b/plugins/protocol_lws_mirror.c\nindex 1570451..380d6c2 100644\n--- a/plugins/protocol_lws_mirror.c\n+++ b/plugins/protocol_lws_mirror.c\n@@ -206,6 +206,15 @@ callback_lws_mirror(struct lws *wsi, enum lws_callback_reasons reason,\n \tswitch (reason) {\n \tcase LWS_CALLBACK_ESTABLISHED:\n \t\tlwsl_info(\u0022%s: LWS_CALLBACK_ESTABLISHED\u005cn\u0022, __func__);\n+\t\tif (!v) {\n+\t\t\tlws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),\n+\t\t\t\t\tlws_get_protocol(wsi),\n+\t\t\t\t\tsizeof(struct per_vhost_data__lws_mirror));\n+\t\t\tv \u003d (struct per_vhost_data__lws_mirror *)\n+\t\t\t\t\tlws_protocol_vh_priv_get(lws_get_vhost(wsi),\n+\t\t\t\t\t\t\t\t lws_get_protocol(wsi));\n+\t\t\tlws_pthread_mutex_init(\u0026v-\u003elock);\n+\t\t}\n \n \t\t/*\n \t\t * mirror instance name... defaults to \u0022\u0022, but if URL includes\n@@ -332,13 +341,15 @@ bail1:\n \t\treturn 1; /* disallow compression */\n \n \tcase LWS_CALLBACK_PROTOCOL_INIT: /* per vhost */\n-\t\tlws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),\n+\t\tif (!v) {\n+\t\t\tlws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),\n \t\t\t\tlws_get_protocol(wsi),\n \t\t\t\tsizeof(struct per_vhost_data__lws_mirror));\n-\t\tv \u003d (struct per_vhost_data__lws_mirror *)\n+\t\t\tv \u003d (struct per_vhost_data__lws_mirror *)\n \t\t\t\tlws_protocol_vh_priv_get(lws_get_vhost(wsi),\n \t\t\t\t\t\t\t lws_get_protocol(wsi));\n-\t\tlws_pthread_mutex_init(\u0026v-\u003elock);\n+\t\t\tlws_pthread_mutex_init(\u0026v-\u003elock);\n+\t\t}\n \t\tbreak;\n \n \tcase LWS_CALLBACK_PROTOCOL_DESTROY:\ndiff --git a/scripts/ctest-background-kill.sh b/scripts/ctest-background-kill.sh\nnew file mode 100755\nindex 0000000..4cbe12e\n--- /dev/null\n+++ b/scripts/ctest-background-kill.sh\n@@ -0,0 +1,54 @@\n+#!/bin/bash\n+#\n+# $SAI_INSTANCE_IDX - which instance of sai, 0+\n+# $1 - background fixture name, unique within test space, like \u0022multipostlocalsrv\u0022\n+# $2 - executable\n+# $3+ - args\n+\n+echo \u0022$0 $1 $2 $3 $4\u0022 \u003e\u003e /tmp/ctklog\n+\n+J\u003d`basename $2`.$1.$SAI_INSTANCE_IDX\n+PI\u003d`cat /tmp/sai-ctest-$J`\n+echo \u0022Stage 1 kill $J 'kill $PI'\u0022 \u003e\u003e /tmp/ctklog\n+\n+#\n+# We expect our background process to still be around\n+#\n+\n+set +e\n+set +E\n+kill -0 $PI 2\u003e\u00261 \u003e\u003e /tmp/ctklog\n+GONESKI\u003d$?\n+\n+if [ $GONESKI -eq 0 ] ; then\n+\tkill $PI 2\u003e\u00261 \u003e\u003e /tmp/ctklog\n+\tkill -9 $PI 2\u003e\u00261 \u003e\u003e /tmp/ctklog\n+\n+\tkill -0 $PI 2\u003e\u00261\n+\tif [ $? -eq 0 ] ; then\n+\t\t#\n+\t\t# but in case it isn't enough, use ps to find the same executable started on the same port\n+\t\t# and kill that\n+\t\t#\n+\t\tA1\u003d$3\n+\t\tif [ -z \u0022$A1\u0022 ] ; then\n+\t\t\tA1\u003d$2\n+\t\tfi\n+\t\tA2\u003d$4\n+\t\tif [ -z \u0022$A2\u0022 ] ; then\n+\t\t\tA2\u003d$2\n+\t\tfi\n+\n+\t\t# sed is there to match up bsd/osx ps with linux\n+\t\tKL\u003d`ps -Af | grep -v ctest-background-kill | grep -v grep | grep $2 | grep $A1 | grep $A2 | tr -s ' ' | sed \u0022s/^\u005c //g\u0022 | cut -d' ' -f2`\n+\t\tif [ ! -z \u0022$KL\u0022 ] ; then\n+\t\t\techo \u0022Stage 2 kill $J 'kill $KL'\u0022 \u003e\u003e /tmp/ctklog\n+\t\t\tkill $KL 2\u003e\u00261 \u003e\u003e /tmp/ctklog\n+\t\tfi\n+\tfi\n+else\n+\techo \u0022Process already dead\u0022 \u003e\u003e /tmp/ctklog\n+fi\n+\n+exit $GONESKI\n+\ndiff --git a/scripts/ctest-background.sh b/scripts/ctest-background.sh\nnew file mode 100755\nindex 0000000..ebfd8c1\n--- /dev/null\n+++ b/scripts/ctest-background.sh\n@@ -0,0 +1,16 @@\n+#!/bin/bash\n+#\n+# $SAI_INSTANCE_IDX - which instance of sai, 0+\n+# $1 - background fixture name, unique within test space, like \u0022multipostlocalserver\u0022\n+# $2 - executable\n+# $3+ - args\n+\n+J\u003d`basename $2`.$1.$SAI_INSTANCE_IDX\n+$2 $3 $4 $5 $6 $7 $8 $9 2\u003e/tmp/ctest-background-$J 1\u003e/dev/null 0\u003c/dev/null \u0026\n+echo $! \u003e /tmp/sai-ctest-$J\n+# really we want to loop until the listen port is up\n+# on, eg, rpi it can be blocked at sd card and slow to start\n+# due to parallel tests and disc cache flush\n+sleep 1\n+exit 0\n+\ndiff --git a/scripts/libwebsockets.spec b/scripts/libwebsockets.spec\ndeleted file mode 100644\nindex 823ff0b..0000000\n--- a/scripts/libwebsockets.spec\n+++ /dev/null\n@@ -1,180 +0,0 @@\n-Name: libwebsockets\n-Version: 4.0.0\n-Release: 1%{?dist}\n-Summary: Websocket Server and Client Library\n-\n-Group: System Environment/Libraries\n-License: MIT\n-URL: https://libwebsockets.org\n-Source0: %{name}-%{version}.tar.gz\n-BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)\n-\n-BuildRequires: openssl-devel libuv-devel libev-devel cmake\n-Requires: openssl\n-\n-%description\n-Webserver server and client library\n-\n-%package devel\n-Summary: Development files for libwebsockets\n-Group: Development/Libraries\n-Requires: %{name} \u003d %{version}-%{release}\n-Requires: openssl-devel\n-\n-%description devel\n-Development files for libwebsockets\n-\n-%prep\n-%setup -q\n-\n-%build\n-mkdir -p build\n-cd build\n-%cmake .. -DLWS_WITH_DISTRO_RECOMMENDED\u003d1\n-make\n-\n-%install\n-rm -rf $RPM_BUILD_ROOT\n-cd build\n-make install DESTDIR\u003d$RPM_BUILD_ROOT\n-\n-%post -p /sbin/ldconfig\n-%postun -p /sbin/ldconfig\n-\n-%clean\n-rm -rf $RPM_BUILD_ROOT\n-\n-%files\n-%defattr(-,root,root,-)\n-%attr(755,root,root)\n-\u0022/usr/bin/libwebsockets-test-client\u0022\n-\u0022/usr/bin/libwebsockets-test-lejp\u0022\n-\u0022/usr/bin/libwebsockets-test-server\u0022\n-\u0022/usr/bin/libwebsockets-test-server-extpoll\u0022\n-\u0022/usr/bin/libwebsockets-test-sshd\u0022\n-\u0022/usr/bin/lwsws\u0022\n-\u0022/%{_libdir}/libwebsockets.so\u0022\n-\u0022/%{_libdir}/libwebsockets.so.16\u0022\n-%dir \u0022/usr/share/libwebsockets-test-server\u0022\n-\u0022/usr/share/libwebsockets-test-server/candide.zip\u0022\n-\u0022/usr/share/libwebsockets-test-server/favicon.ico\u0022\n-%dir \u0022/usr/share/libwebsockets-test-server/generic-table\u0022\n-\u0022/usr/share/libwebsockets-test-server/generic-table/index.html\u0022\n-\u0022/usr/share/libwebsockets-test-server/generic-table/lwsgt.js\u0022\n-\u0022/usr/share/libwebsockets-test-server/http2.png\u0022\n-\u0022/usr/share/libwebsockets-test-server/leaf.jpg\u0022\n-\u0022/usr/share/libwebsockets-test-server/libwebsockets-test-server.key.pem\u0022\n-\u0022/usr/share/libwebsockets-test-server/libwebsockets-test-server.pem\u0022\n-\u0022/usr/share/libwebsockets-test-server/libwebsockets.org-logo.svg\u0022\n-\u0022/usr/share/libwebsockets-test-server/lws-cgi-test.sh\u0022\n-\u0022/usr/share/libwebsockets-test-server/lws-common.js\u0022\n-\u0022/usr/share/libwebsockets-test-server/lws-ssh-test-keys\u0022\n-\u0022/usr/share/libwebsockets-test-server/lws-ssh-test-keys.pub\u0022\n-%dir \u0022/usr/share/libwebsockets-test-server/plugins\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_client_loopback_test.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_dumb_increment.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_fulltext_demo.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_acme_client.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_mirror.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_raw_test.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_server_status.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_ssh_base.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_sshd_demo.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_status.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_lws_table_dirlisting.so\u0022\n-\u0022/usr/share/libwebsockets-test-server/plugins/libprotocol_post_demo.so\u0022\n-%dir \u0022/usr/share/libwebsockets-test-server/private\u0022\n-\u0022/usr/share/libwebsockets-test-server/private/index.html\u0022\n-%dir \u0022/usr/share/libwebsockets-test-server/server-status\u0022\n-\u0022/usr/share/libwebsockets-test-server/server-status/lwsws-logo.png\u0022\n-\u0022/usr/share/libwebsockets-test-server/server-status/server-status.css\u0022\n-\u0022/usr/share/libwebsockets-test-server/server-status/server-status.html\u0022\n-\u0022/usr/share/libwebsockets-test-server/server-status/server-status.js\u0022\n-\u0022/usr/share/libwebsockets-test-server/test.css\u0022\n-\u0022/usr/share/libwebsockets-test-server/test.html\u0022\n-\u0022/usr/share/libwebsockets-test-server/test.js\u0022\n-\u0022/usr/share/libwebsockets-test-server/wss-over-h2.png\u0022\n-%files devel\n-%defattr(-,root,root,-)\n-%dir \u0022/usr/include/libwebsockets\u0022\n-\u0022/usr/include/libwebsockets.h\u0022\n-\u0022/usr/include/libwebsockets/lws-adopt.h\u0022\n-\u0022/usr/include/libwebsockets/lws-callbacks.h\u0022\n-\u0022/usr/include/libwebsockets/lws-cgi.h\u0022\n-\u0022/usr/include/libwebsockets/lws-client.h\u0022\n-\u0022/usr/include/libwebsockets/lws-context-vhost.h\u0022\n-\u0022/usr/include/libwebsockets/lws-dbus.h\u0022\n-\u0022/usr/include/libwebsockets/lws-diskcache.h\u0022\n-\u0022/usr/include/libwebsockets/lws-esp32.h\u0022\n-\u0022/usr/include/libwebsockets/lws-fts.h\u0022\n-\u0022/usr/include/libwebsockets/lws-genhash.h\u0022\n-\u0022/usr/include/libwebsockets/lws-genrsa.h\u0022\n-\u0022/usr/include/libwebsockets/lws-http.h\u0022\n-\u0022/usr/include/libwebsockets/lws-jose.h\u0022\n-\u0022/usr/include/libwebsockets/lws-jwk.h\u0022\n-\u0022/usr/include/libwebsockets/lws-jws.h\u0022\n-\u0022/usr/include/libwebsockets/lws-lejp.h\u0022\n-\u0022/usr/include/libwebsockets/lws-logs.h\u0022\n-\u0022/usr/include/libwebsockets/lws-lwsac.h\u0022\n-\u0022/usr/include/libwebsockets/lws-misc.h\u0022\n-\u0022/usr/include/libwebsockets/lws-network-helper.h\u0022\n-\u0022/usr/include/libwebsockets/lws-plugin-generic-sessions.h\u0022\n-\u0022/usr/include/libwebsockets/lws-protocols-plugins.h\u0022\n-\u0022/usr/include/libwebsockets/lws-purify.h\u0022\n-\u0022/usr/include/libwebsockets/lws-ring.h\u0022\n-\u0022/usr/include/libwebsockets/lws-service.h\u0022\n-\u0022/usr/include/libwebsockets/lws-sha1-base64.h\u0022\n-\u0022/usr/include/libwebsockets/lws-spa.h\u0022\n-\u0022/usr/include/libwebsockets/lws-stats.h\u0022\n-\u0022/usr/include/libwebsockets/lws-threadpool.h\u0022\n-\u0022/usr/include/libwebsockets/lws-timeout-timer.h\u0022\n-\u0022/usr/include/libwebsockets/lws-tokenize.h\u0022\n-\u0022/usr/include/libwebsockets/lws-vfs.h\u0022\n-\u0022/usr/include/libwebsockets/lws-write.h\u0022\n-\u0022/usr/include/libwebsockets/lws-writeable.h\u0022\n-\u0022/usr/include/libwebsockets/lws-ws-close.h\u0022\n-\u0022/usr/include/libwebsockets/lws-ws-ext.h\u0022\n-\u0022/usr/include/libwebsockets/lws-ws-state.h\u0022\n-\u0022/usr/include/libwebsockets/lws-x509.h\u0022\n-\u0022/usr/include/lws-plugin-ssh.h\u0022\n-\u0022/usr/include/lws_config.h\u0022\n-%dir \u0022/usr/lib/pkgconfig\u0022\n-\u0022/%{_libdir}/pkgconfig/libwebsockets.pc\u0022\n-\u0022/usr/lib/pkgconfig/libwebsockets_static.pc\u0022\n-%dir \u0022/usr/lib/cmake\u0022\n-%dir \u0022/usr/lib/cmake/libwebsockets\u0022\n-\u0022/%{_libdir}/cmake/libwebsockets/LibwebsocketsConfig.cmake\u0022\n-\u0022/%{_libdir}/cmake/libwebsockets/LibwebsocketsConfigVersion.cmake\u0022\n-\u0022/%{_libdir}/cmake/libwebsockets/LibwebsocketsTargets-debug.cmake\u0022\n-\u0022/%{_libdir}/cmake/libwebsockets/LibwebsocketsTargets.cmake\u0022\n-\n-%changelog\n-* Fri Aug 14 2019 Andy Green \u003candy@warmcat.com\u003e 3.2.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 3.2.0 release (last LGPLv2.1+SLE)\n-\n-* Fri Nov 23 2018 Andy Green \u003candy@warmcat.com\u003e 3.1.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 3.1.0 release\n-\n-* Fri May 4 2018 Andy Green \u003candy@warmcat.com\u003e 3.0.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 3.0.0 release\n-\n-* Mon Oct 16 2017 Andy Green \u003candy@warmcat.com\u003e 2.4.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 2.4.0 release\n-\n-* Fri Jul 28 2017 Andy Green \u003candy@warmcat.com\u003e 2.3.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 2.3.0 release\n-\n-* Mon Mar 06 2017 Andy Green \u003candy@warmcat.com\u003e 2.2.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 2.2.0 release\n-\n-* Thu Oct 06 2016 Andy Green \u003candy@warmcat.com\u003e 2.1.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 2.1.0 release\n-\n-* Thu May 05 2016 Andy Green \u003candy@warmcat.com\u003e 2.0.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 2.0.0 release\n-\n-* Tue Feb 16 2016 Andy Green \u003candy@warmcat.com\u003e 1.7.0-1\n-- MAJOR SONAMEBUMP APICHANGES Upstream 1.7.0 release\n-\n-* Sun Jan 17 2016 Andrew Cooks \u003cacooks@linux.com\u003e 1.6.0-1\n-- Bump version to 1.6.0\ndiff --git a/test-apps/test-server.c b/test-apps/test-server.c\nindex 0da86b0..2dc6769 100644\n--- a/test-apps/test-server.c\n+++ b/test-apps/test-server.c\n@@ -317,6 +317,7 @@ static struct option options[] \u003d {\n \t{ \u0022ssl-cert\u0022, required_argument,\tNULL, 'C' },\n \t{ \u0022ssl-key\u0022, required_argument,\tNULL, 'K' },\n \t{ \u0022ssl-ca\u0022, required_argument,\t\tNULL, 'A' },\n+\t{ \u0022resource-path\u0022, required_argument,\t\tNULL, 'r' },\n #if defined(LWS_WITH_TLS)\n \t{ \u0022ssl-verify-client\u0022,\tno_argument,\t\tNULL, 'v' },\n #if defined(LWS_HAVE_SSL_CTX_set1_param)\n@@ -329,10 +330,17 @@ static struct option options[] \u003d {\n \t{ \u0022daemonize\u0022,\tno_argument,\t\tNULL, 'D' },\n #endif\n \t{ \u0022pingpong-secs\u0022, required_argument,\tNULL, 'P' },\n+\t{ \u0022ignore-sigterm\u0022, no_argument,\tNULL, 'I' },\n+\n \t{ NULL, 0, 0, 0 }\n };\n #endif\n \n+static void\n+sigterm_catch(int sig)\n+{\n+}\n+\n int main(int argc, char **argv)\n {\n \tstruct lws_context_creation_info info;\n@@ -360,9 +368,9 @@ int main(int argc, char **argv)\n \n \twhile (n \u003e\u003d 0) {\n #if defined(LWS_HAS_GETOPT_LONG) || defined(WIN32)\n-\t\tn \u003d getopt_long(argc, argv, \u0022eci:hsap:d:DC:K:A:R:vu:g:P:kU:n\u0022, options, NULL);\n+\t\tn \u003d getopt_long(argc, argv, \u0022eci:hsap:d:DC:K:A:R:vu:g:P:kU:niIr:\u0022, options, NULL);\n #else\n-\t\tn \u003d getopt(argc, argv, \u0022eci:hsap:d:DC:K:A:R:vu:g:P:kU:n\u0022);\n+\t\tn \u003d getopt(argc, argv, \u0022eci:hsap:d:DC:K:A:R:vu:g:P:kU:nIr:\u0022);\n #endif\n \t\tif (n \u003c 0)\n \t\t\tcontinue;\n@@ -388,6 +396,12 @@ int main(int argc, char **argv)\n \t\t\t/* no dumb increment send */\n \t\t\ttest_options |\u003d 1;\n \t\t\tbreak;\n+\t\tcase 'I':\n+\t\t\tsignal(SIGTERM, sigterm_catch);\n+\t\t\tbreak;\n+\t\tcase 'r':\n+\t\t\tresource_path \u003d optarg;\n+\t\t\tbreak;\n \t\tcase 's':\n \t\t\tuse_ssl \u003d 1;\n \t\t\topts |\u003d LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT;\n@@ -539,8 +553,8 @@ int main(int argc, char **argv)\n \t\t\t \u0022!AES256-GCM-SHA384:\u0022\n \t\t\t \u0022!AES256-SHA256\u0022;\n \tinfo.mounts \u003d \u0026mount;\n-\tinfo.ip_limit_ah \u003d 24; /* for testing */\n-\tinfo.ip_limit_wsi \u003d 400; /* for testing */\n+\tinfo.ip_limit_ah \u003d 128; /* for testing */\n+\tinfo.ip_limit_wsi \u003d 800; /* for testing */\n \n \tif (use_ssl)\n \t\t/* redirect guys coming on http */\ndiff --git a/win32port/version.rc.in b/win32port/version.rc.in\nindex 8a70f2d..0dd48fe 100644\n--- a/win32port/version.rc.in\n+++ b/win32port/version.rc.in\n@@ -1,12 +1,13 @@\n #include \u003cwinver.h\u003e\n \n+#define LWS_NUMVERSION \t@LWS_LIBRARY_VERSION_MAJOR@,@LWS_LIBRARY_VERSION_MINOR@,0\n #define LWS_VERSION \t@LWS_LIBRARY_VERSION_MAJOR@,@LWS_LIBRARY_VERSION_MINOR@,@LWS_LIBRARY_VERSION_PATCH@,0\n #define LWS_VERSION_STR \u0022@LWS_LIBRARY_VERSION_MAJOR@.@LWS_LIBRARY_VERSION_MINOR@.@LWS_LIBRARY_VERSION_PATCH@\u005c0\u0022\n #define LWS_PACKAGE_NAME \u0022@PACKAGE@\u005c0\u0022\n \n VS_VERSION_INFO VERSIONINFO\n- FILEVERSION LWS_VERSION\n- PRODUCTVERSION LWS_VERSION\n+ FILEVERSION LWS_NUMVERSION\n+ PRODUCTVERSION LWS_NUMVERSION\n FILEFLAGSMASK VS_FFI_FILEFLAGSMASK\n FILEFLAGS 0\n FILEOS VOS__WINDOWS32\n","s":{"c":1750972590,"u": 26104}}
],"g": 5711,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}