From fe8170dcdc7c833c2560e1f8860a73e4408b7cc2 Mon Sep 17 00:00:00 2001 From: Joerg Wendel Date: Tue, 7 Dec 2021 14:20:47 +0000 Subject: [PATCH] http: server: added no-cache handling to mounts --- READMEs/README.coding.md | 64 +++++++++---------- include/libwebsockets.h | 3 + include/libwebsockets/lws-context-vhost.h | 1 + lib/core-net/private-lib-core-net.h | 1 + lib/roles/http/server/lejp-conf.c | 5 ++ lib/roles/http/server/server.c | 18 ++++-- .../minimal-ws-proxy/minimal-ws-proxy.c | 1 + .../minimal-http-server-basicauth.c | 2 + .../minimal-http-server.c | 1 + .../minimal-http-server-custom-headers.c | 2 + .../minimal-http-server-deaddrop.c | 3 + .../minimal-http-server-dynamic.c | 2 + .../minimal-http-server.c | 1 + .../minimal-http-server-eventlib-demos.c | 6 +- .../minimal-http-server-eventlib-foreign.c | 1 + .../minimal-http-server-eventlib-smp.c | 3 +- .../minimal-http-server-eventlib.c | 3 +- .../minimal-http-server-form-get.c | 1 + .../minimal-http-server-form-post-file.c | 1 + .../minimal-http-server-form-post.c | 1 + .../minimal-http-server-form-post.c | 1 + .../minimal-http-server.c | 2 + .../minimal-http-server-mimetypes.c | 3 +- .../minimal-http-server.c | 5 +- .../minimal-http-server-proxy.c | 1 + .../minimal-http-server-smp.c | 1 + .../minimal-http-server-sse-ring.c | 2 + .../minimal-http-server-sse.c | 2 + .../minimal-http-server-tls-80.c | 4 +- .../minimal-http-server-tls-mem.c | 3 +- .../minimal-http-server-tls.c | 4 +- .../minimal-http-server/minimal-http-server.c | 24 ++----- .../minimal-raw-fallback-http-server.c | 3 +- .../minimal-raw-proxy-fallback.c | 1 + .../minimal-ws-broker/minimal-ws-broker.c | 1 + .../minimal-ws-raw-proxy.c | 1 + .../minimal-ws-server-pmd-bulk.c | 1 + .../minimal-ws-server-pmd-corner.c | 1 + .../minimal-ws-server-pmd.c | 1 + .../minimal-ws-server-ring.c | 1 + .../minimal-ws-server-threadpool.c | 1 + .../minimal-ws-server.c | 1 + .../minimal-ws-server.c | 1 + .../minimal-ws-server.c | 1 + .../minimal-ws-server.c | 1 + .../minimal-ws-server/minimal-ws-server.c | 1 + test-apps/test-server.c | 4 ++ 47 files changed, 126 insertions(+), 66 deletions(-) diff --git a/READMEs/README.coding.md b/READMEs/README.coding.md index d1143f5690..43aed1d9b1 100644 --- a/READMEs/README.coding.md +++ b/READMEs/README.coding.md @@ -45,7 +45,7 @@ If you want to send something, do NOT just send it but request a callback when the socket is writeable using - `lws_callback_on_writable(wsi)` for a specific `wsi`, or - + - `lws_callback_on_writable_all_protocol(protocol)` for all connections using that protocol to get a callback when next writeable. @@ -66,7 +66,7 @@ Libwebsockets' concept is that the downstream peer is truly the boss, if he, or our connection to him, cannot handle anything new, we should not generate anything new for him. This is how unix shell piping works, you may have `cat a.txt | grep xyz > remote", but actually that does not cat anything from -a.txt while remote cannot accept anything new. +a.txt while remote cannot accept anything new. @section oneper Only one lws_write per WRITEABLE callback @@ -225,7 +225,7 @@ in that case by default it will bind to the first protocol in your vhost protocols[] array. You can tell the vhost to use a different protocol by attaching a -pvo (per-vhost option) to the +pvo (per-vhost option) to the ``` /* @@ -318,14 +318,14 @@ to gather the whole contents of a message, eg: { Client * const client = (Client *)user; const size_t remaining = lws_remaining_packet_payload(wsi); - + if (!remaining && lws_is_final_fragment(wsi)) { if (client->HasFragments()) { client->AppendMessageFragment(in, len, 0); in = (void *)client->GetMessage(); len = client->GetMessageLength(); } - + client->ProcessMessage((char *)in, len, wsi); client->ResetMessage(); } else @@ -383,7 +383,7 @@ reflecting the real event: - check the built-in support for the event loop if possible (eg, ./lib/libuv.c) to see how it interfaces to lws - + - use LWS_POLLHUP / LWS_POLLIN / LWS_POLLOUT from libwebsockets.h to avoid losing windows compatibility @@ -467,18 +467,18 @@ header access apis are already made compatible for incoming headers, for outgoing headers you must: - observe the LWS_PRE buffer requirement mentioned above - + - Use `lws_add_http_header_status()` to add the transaction status (200 etc) - + - use lws apis `lws_add_http_header_by_name()` and `lws_add_http_header_by_token()` to put the headers into the buffer (these will translate what is actually written to the buffer depending on if the connection is in http/2 mode or not) - + - use the `lws api lws_finalize_http_header()` api after adding the last response header - + - write the header using lws_write(..., `LWS_WRITE_HTTP_HEADERS`); - + 3) http/2 introduces per-stream transmit credit... how much more you can send on a stream is decided by the peer. You start off with some amount, as the stream sends stuff lws will reduce your credit accordingly, when it reaches @@ -489,7 +489,7 @@ for outgoing headers you must: you write your own code that wants to send http data, you must consult the `lws_get_peer_write_allowance()` api to find out the state of your tx credit. For http/1, it will always return (size_t)-1, ie, no limit. - + This is orthogonal to the question of how much space your local side's kernel will make to buffer your send data on that connection. So although the result from `lws_get_peer_write_allowance()` is "how much you can send" logically, @@ -499,15 +499,15 @@ for outgoing headers you must: something smaller. If it returns 0, you should not consume or send anything and return having asked for callback on writable, it will only come back when more tx credit has arrived for your stream. - + 4) Header names with captital letters are illegal in http/2. Header names in http/1 are case insensitive. So if you generate headers by name, change all your header name strings to lower-case to be compatible both ways. - + 5) Chunked Transfer-encoding is illegal in http/2, http/2 peers will actively reject it. Lws takes care of removing the header and converting CGIs that emit chunked into unchunked automatically for http/2 connections. - + If you follow these rules, your code will automatically work with both http/1.x and http/2. @@ -769,7 +769,7 @@ Run libwebsockets-test-server-v2.0 and connect to it by telnet, eg type something that isn't a valid HTTP method and enter, before the connection times out. The connection will switch to RAW mode using this protocol, and pass the unused rx as a raw RX callback. - + The test protocol echos back what was typed on telnet to telnet. @section rawclientsocket RAW client socket descriptor polling @@ -841,7 +841,7 @@ the remainder depending on what you are doing). ECDH Certs are now supported. Enable the CMake option - cmake .. -DLWS_SSL_SERVER_WITH_ECDH_CERT=1 + cmake .. -DLWS_SSL_SERVER_WITH_ECDH_CERT=1 **and** the info->options flag @@ -885,7 +885,7 @@ Two new members are added to the info struct unsigned int count_threads; unsigned int fd_limit_per_thread; - + leave them at the default 0 to get the normal singlethreaded service loop. Set count_threads to n to tell lws you will have n simultaneous service threads @@ -1146,7 +1146,7 @@ match, it will have been chosen in preference to this. Connections with SSL will still have the client go on to check the certificate allows wildcards and error out if not. - + @section mounts Using lws mounts on a vhost @@ -1162,16 +1162,17 @@ filesystem how you like and deal with the contents transparently. const char *mountpoint; /* mountpoint in http pathspace, eg, "/" */ const char *origin; /* path to be mounted, eg, "/var/www/warmcat.com" */ const char *def; /* default target, eg, "index.html" */ - + struct lws_protocol_vhost_options *cgienv; - + int cgi_timeout; int cache_max_age; - + unsigned int cache_reusable:1; unsigned int cache_revalidate:1; unsigned int cache_intermediaries:1; - + unsigned int cache_no:1; + unsigned char origin_protocol; unsigned char mountpoint_len; }; @@ -1304,19 +1305,19 @@ is still connected to the server, by greying out the page if not. You can also add this to your own html easily - include lws-common.js from your HEAD section - + \ - + - dim the page during initialization, in a script section on your page - + lws_gray_out(true,{'zindex':'499'}); - + - in your ws onOpen(), remove the dimming - + lws_gray_out(false); - + - in your ws onClose(), reapply the dimming - + lws_gray_out(true,{'zindex':'499'}); @section errstyle Styling http error pages @@ -1331,7 +1332,6 @@ context / vhost info struct (`struct lws_context_creation_info`) member If it wasn't redirected, then the response code html is synthesized containing the user-selected text message and attempts to pull in `/error.css` for styling. -If this file exists, it can be used to style the error page. See +If this file exists, it can be used to style the error page. See https://libwebsockets.org/git/badrepo for an example of what can be done ( and https://libwebsockets.org/error.css for the corresponding css). - diff --git a/include/libwebsockets.h b/include/libwebsockets.h index 9205bff6c2..6e0b10d777 100644 --- a/include/libwebsockets.h +++ b/include/libwebsockets.h @@ -388,6 +388,9 @@ struct lws; /* File operations stuff exists */ #define LWS_FEATURE_FOPS +/* Mounts have extra no_cache member */ +#define LWS_FEATURE_MOUNT_NO_CACHE + #if defined(_WIN32) #if !defined(LWS_WIN32_HANDLE_TYPES) diff --git a/include/libwebsockets/lws-context-vhost.h b/include/libwebsockets/lws-context-vhost.h index 1da5ff2f60..9201610d37 100644 --- a/include/libwebsockets/lws-context-vhost.h +++ b/include/libwebsockets/lws-context-vhost.h @@ -1349,6 +1349,7 @@ struct lws_http_mount { unsigned int cache_reusable:1; /**< set if client cache may reuse this */ unsigned int cache_revalidate:1; /**< set if client cache should revalidate on use */ unsigned int cache_intermediaries:1; /**< set if intermediaries are allowed to cache */ + unsigned int cache_no:1; /**< set if client should check cache always*/ unsigned char origin_protocol; /**< one of enum lws_mount_protocols */ unsigned char mountpoint_len; /**< length of mountpoint string */ diff --git a/lib/core-net/private-lib-core-net.h b/lib/core-net/private-lib-core-net.h index dea16dae78..67d45a65fd 100644 --- a/lib/core-net/private-lib-core-net.h +++ b/lib/core-net/private-lib-core-net.h @@ -780,6 +780,7 @@ struct lws { unsigned int cache_reuse:1; unsigned int cache_revalidate:1; unsigned int cache_intermediaries:1; + unsigned int cache_no:1; unsigned int favoured_pollin:1; unsigned int sending_chunked:1; unsigned int interpreting:1; diff --git a/lib/roles/http/server/lejp-conf.c b/lib/roles/http/server/lejp-conf.c index 98392d4ad3..501e02b27b 100644 --- a/lib/roles/http/server/lejp-conf.c +++ b/lib/roles/http/server/lejp-conf.c @@ -92,6 +92,7 @@ static const char * const paths_vhosts[] = { "vhosts[].mounts[].cache-max-age", "vhosts[].mounts[].cache-reuse", "vhosts[].mounts[].cache-revalidate", + "vhosts[].mounts[].cache-no", "vhosts[].mounts[].basic-auth", "vhosts[].mounts[].cache-intermediaries", "vhosts[].mounts[].extra-mimetypes.*", @@ -161,6 +162,7 @@ enum lejp_vhost_paths { LEJPVP_MOUNT_CACHE_MAX_AGE, LEJPVP_MOUNT_CACHE_REUSE, LEJPVP_MOUNT_CACHE_REVALIDATE, + LEJPVP_MOUNT_CACHE_NO, LEJPVP_MOUNT_BASIC_AUTH, LEJPVP_MOUNT_CACHE_INTERMEDIARIES, LEJPVP_MOUNT_EXTRA_MIMETYPES, @@ -684,6 +686,9 @@ lejp_vhosts_cb(struct lejp_ctx *ctx, char reason) case LEJPVP_MOUNT_CACHE_REVALIDATE: a->m.cache_revalidate = !!arg_to_bool(ctx->buf); return 0; + case LEJPVP_MOUNT_CACHE_NO: + a->m.cache_no = !!arg_to_bool(ctx->buf); + return 0; case LEJPVP_MOUNT_CACHE_INTERMEDIARIES: a->m.cache_intermediaries = !!arg_to_bool(ctx->buf);; return 0; diff --git a/lib/roles/http/server/server.c b/lib/roles/http/server/server.c index bd38a33f7e..bcde75f34b 100644 --- a/lib/roles/http/server/server.c +++ b/lib/roles/http/server/server.c @@ -1923,6 +1923,7 @@ lws_http_action(struct lws *wsi) wsi->cache_secs = (unsigned int)hit->cache_max_age; wsi->cache_reuse = hit->cache_reusable; wsi->cache_revalidate = hit->cache_revalidate; + wsi->cache_no = hit->cache_no; wsi->cache_intermediaries = hit->cache_intermediaries; #if defined(LWS_WITH_FILE_OPS) @@ -2944,19 +2945,22 @@ lws_serve_http_file(struct lws *wsi, const char *file, const char *content_type, } } - if (wsi->cache_secs && wsi->cache_reuse) { + if (wsi->cache_no) { + cc = cache_control; + cclen = sprintf(cache_control, "no-cache"); + } + else if (wsi->cache_secs && wsi->cache_reuse) { if (!wsi->cache_revalidate) { cc = cache_control; cclen = sprintf(cache_control, "%s, max-age=%u", - intermediates[wsi->cache_intermediaries], - wsi->cache_secs); + intermediates[wsi->cache_intermediaries], + wsi->cache_secs); } else { cc = cache_control; cclen = sprintf(cache_control, - "must-revalidate, %s, max-age=%u", - intermediates[wsi->cache_intermediaries], - wsi->cache_secs); - + "must-revalidate, %s, max-age=%u", + intermediates[wsi->cache_intermediaries], + wsi->cache_secs); } } diff --git a/minimal-examples-lowlevel/client-server/minimal-ws-proxy/minimal-ws-proxy.c b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/minimal-ws-proxy.c index e304c61880..07f853dede 100644 --- a/minimal-examples-lowlevel/client-server/minimal-ws-proxy/minimal-ws-proxy.c +++ b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/minimal-ws-proxy.c @@ -47,6 +47,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c index 1336d287a6..f275a74c30 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c @@ -39,6 +39,7 @@ static const struct lws_http_mount mount_secret = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* dynamic */ /* .mountpoint_len */ 7, /* char count */ /* .basic_auth_login_file */ "./ba-passwords", @@ -61,6 +62,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/minimal-http-server.c index 1e8bc91e4d..9718010cf2 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/minimal-http-server.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/minimal-http-server.c @@ -35,6 +35,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CGI, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c index d9a1f31ab5..9cdc55529d 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c @@ -124,6 +124,7 @@ static const struct lws_http_mount mount_dyn = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */ /* .mountpoint_len */ 4, /* char count */ /* .basic_auth_login_file */ NULL, @@ -146,6 +147,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c index 97902acf07..242e0e2d93 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c @@ -60,6 +60,7 @@ static const struct lws_http_mount mount_upload = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CALLBACK, /* .mountpoint_len */ 7, /* char count */ /* .basic_auth_login_file */ "./ba-passwords", @@ -82,6 +83,7 @@ static const struct lws_http_mount mount_get = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* dynamic */ /* .mountpoint_len */ 4, /* char count */ /* .basic_auth_login_file */ "./ba-passwords", @@ -104,6 +106,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ "./ba-passwords", diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c index f919146b34..ed3c1a237c 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c @@ -238,6 +238,7 @@ static const struct lws_http_mount mount_dyn = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */ /* .mountpoint_len */ 4, /* char count */ /* .basic_auth_login_file */ NULL, @@ -260,6 +261,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c index e969fea2b9..8946bb74fb 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c @@ -290,6 +290,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c index be060da7cc..bce9059116 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c @@ -9,7 +9,7 @@ * This demonstrates a minimal http[s] server that can work with any of the * supported event loop backends, or the default poll() one. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * You can change that by changing mount.origin below. */ @@ -56,6 +56,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 0, 0, 0, + 0, LWSMPRO_FILE, /* origin points to a callback */ 14, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, @@ -74,6 +75,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 0, 0, 0, + 0, LWSMPRO_FILE, /* origin points to a callback */ 8, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, @@ -93,6 +95,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 0, 0, 0, + 0, LWSMPRO_CALLBACK, /* origin points to a callback */ 9, /* strlen("/formtest"), ie length of the mountpoint */ NULL, @@ -112,6 +115,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c index a2a695db7f..a51d780678 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c @@ -53,6 +53,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c index 7a7f3f7cf2..89a5532db3 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c @@ -9,7 +9,7 @@ * This demonstrates a minimal http[s] server that can work with any of the * supported event loop backends, or the default poll() one. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * You can change that by changing mount.origin below. */ @@ -47,6 +47,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c index a1fed6d4eb..a489a92183 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c @@ -9,7 +9,7 @@ * This demonstrates a minimal http[s] server that can work with any of the * supported event loop backends, or the default poll() one. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * You can change that by changing mount.origin below. */ @@ -35,6 +35,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c index d0ce969e6d..a192614339 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c @@ -94,6 +94,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c index 0b41f40486..f2f943943c 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c @@ -209,6 +209,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c index b4e16064b4..7101d3d34a 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c @@ -161,6 +161,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c index 58af16ee4f..bb41d47ac7 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c @@ -155,6 +155,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/minimal-http-server.c index 010ef7487d..0b1d4ca490 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/minimal-http-server.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/minimal-http-server.c @@ -55,6 +55,7 @@ static const struct lws_http_mount mount_fts = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */ /* .mountpoint_len */ 4, /* char count */ /* .basic_auth_login_file */ NULL, @@ -75,6 +76,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c index 660382180d..535b60f383 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c @@ -8,7 +8,7 @@ * * This demonstrates the most minimal http server you can make with lws. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * You can change that by changing mount.origin below. */ @@ -41,6 +41,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/minimal-http-server.c index 0e90016466..3bac15e151 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/minimal-http-server.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/minimal-http-server.c @@ -8,7 +8,7 @@ * * This demonstrates the most minimal http server you can make with lws. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * You can change that by changing mount.origin below. */ @@ -34,6 +34,7 @@ static const struct lws_http_mount mount_localhost1 = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, @@ -52,6 +53,7 @@ static const struct lws_http_mount mount_localhost1 = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, @@ -70,6 +72,7 @@ static const struct lws_http_mount mount_localhost1 = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c index af9b1a2c5a..fcf3f2e501 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c @@ -29,6 +29,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_HTTPS, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-smp/minimal-http-server-smp.c b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/minimal-http-server-smp.c index b542c64cd1..b32085cdda 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-smp/minimal-http-server-smp.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/minimal-http-server-smp.c @@ -49,6 +49,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c index faef2f64c2..e6d7d87bc8 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c @@ -328,6 +328,7 @@ static const struct lws_http_mount mount_sse = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */ /* .mountpoint_len */ 4, /* char count */ /* .basic_auth_login_file */ NULL, @@ -350,6 +351,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-sse/minimal-http-server-sse.c b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/minimal-http-server-sse.c index a87a7c2e7e..12fc088e3d 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-sse/minimal-http-server-sse.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/minimal-http-server-sse.c @@ -148,6 +148,7 @@ static const struct lws_http_mount mount_sse = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */ /* .mountpoint_len */ 4, /* char count */ /* .basic_auth_login_file */ NULL, @@ -170,6 +171,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c index 178500dbdf..b6e2546259 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c @@ -13,7 +13,7 @@ * In addition, it runs a vhost on port 80 with the job of redirecting * and upgrading http clients that came in on port 80 to https on port 443. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * * You can change that by changing mount.origin below. @@ -40,6 +40,7 @@ static const struct lws_http_mount mount80 = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_REDIR_HTTPS, /* https redir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, @@ -60,6 +61,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c index 56304bf97c..254cacac9d 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c @@ -10,7 +10,7 @@ * with three extra lines giving it tls (ssl) capabilities, which in * turn allow operation with HTTP/2 if lws was configured for it. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * * You can change that by changing mount.origin below. @@ -37,6 +37,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server-tls/minimal-http-server-tls.c b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/minimal-http-server-tls.c index a72a231650..3c09dc1a64 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server-tls/minimal-http-server-tls.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/minimal-http-server-tls.c @@ -10,7 +10,7 @@ * with three extra lines giving it tls (ssl) capabilities, which in * turn allow operation with HTTP/2 if lws was configured for it. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * * You can change that by changing mount.origin below. @@ -47,6 +47,7 @@ static const struct lws_http_mount /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_CALLBACK, /* bind to callback */ /* .mountpoint_len */ 8, /* char count */ /* .basic_auth_login_file */ NULL, @@ -71,6 +72,7 @@ static const struct lws_http_mount /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/http-server/minimal-http-server/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server/minimal-http-server.c index 7bd74e2bae..3822940341 100644 --- a/minimal-examples-lowlevel/http-server/minimal-http-server/minimal-http-server.c +++ b/minimal-examples-lowlevel/http-server/minimal-http-server/minimal-http-server.c @@ -8,7 +8,7 @@ * * This demonstrates the most minimal http server you can make with lws. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * You can change that by changing mount.origin below. */ @@ -20,23 +20,11 @@ static int interrupted; static const struct lws_http_mount mount = { - /* .mount_next */ NULL, /* linked-list "next" */ - /* .mountpoint */ "/", /* mountpoint URL */ - /* .origin */ "./mount-origin", /* serve from dir */ - /* .def */ "index.html", /* default filename */ - /* .protocol */ NULL, - /* .cgienv */ NULL, - /* .extra_mimetypes */ NULL, - /* .interpret */ NULL, - /* .cgi_timeout */ 0, - /* .cache_max_age */ 0, - /* .auth_mask */ 0, - /* .cache_reusable */ 0, - /* .cache_revalidate */ 0, - /* .cache_intermediaries */ 0, - /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ - /* .mountpoint_len */ 1, /* char count */ - /* .basic_auth_login_file */ NULL, + .mountpoint = "/", /* mountpoint URL */ + .origin = "./mount-origin", /* serve from dir */ + .def = "index.html", /* default filename */ + .origin_protocol = LWSMPRO_FILE, /* files in a dir */ + .mountpoint_len = 1, /* char count */ }; void sigint_handler(int sig) diff --git a/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c index 59f95afcf5..6456762898 100644 --- a/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c +++ b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c @@ -8,7 +8,7 @@ * * This demonstrates the most minimal http server you can make with lws. * - * To keep it simple, it serves stuff from the subdirectory + * To keep it simple, it serves stuff from the subdirectory * "./mount-origin" of the directory it was started in. * You can change that by changing mount.origin below. * @@ -42,6 +42,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c index 2d290ec4bd..cc766de915 100644 --- a/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c +++ b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c @@ -46,6 +46,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-broker/minimal-ws-broker.c b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/minimal-ws-broker.c index cab9af5501..7765e80c86 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-broker/minimal-ws-broker.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/minimal-ws-broker.c @@ -44,6 +44,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c index 6f66c44592..c6a6c39b51 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c @@ -390,6 +390,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c index fbda461242..bf8be53837 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c @@ -66,6 +66,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c index 06ecb67968..43219ad1d9 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c @@ -43,6 +43,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c index 4496a351d9..f58d0acde6 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c @@ -43,6 +43,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c index f4e02a28ef..2309b5dd44 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c @@ -44,6 +44,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c index 63a120241e..7edd421771 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c @@ -55,6 +55,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c index 1b8299a4d8..175cf6713f 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c @@ -61,6 +61,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c index 925bca476c..50c223791d 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c @@ -59,6 +59,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/minimal-ws-server.c index 9e4627e6ea..6dd76e1c0a 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/minimal-ws-server.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/minimal-ws-server.c @@ -55,6 +55,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/minimal-ws-server.c index a7f0d1acc5..e450eaf842 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/minimal-ws-server.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/minimal-ws-server.c @@ -75,6 +75,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/minimal-examples-lowlevel/ws-server/minimal-ws-server/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server/minimal-ws-server.c index 6cfce7f93b..0d96915444 100644 --- a/minimal-examples-lowlevel/ws-server/minimal-ws-server/minimal-ws-server.c +++ b/minimal-examples-lowlevel/ws-server/minimal-ws-server/minimal-ws-server.c @@ -49,6 +49,7 @@ static const struct lws_http_mount mount = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL, diff --git a/test-apps/test-server.c b/test-apps/test-server.c index 36fec50e74..20de3ee694 100644 --- a/test-apps/test-server.c +++ b/test-apps/test-server.c @@ -275,6 +275,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 0, 0, 0, + 0, LWSMPRO_FILE, /* origin points to a callback */ 14, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, @@ -293,6 +294,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 0, 0, 0, + 0, LWSMPRO_FILE, /* origin points to a callback */ 8, /* strlen("/ziptest"), ie length of the mountpoint */ NULL, @@ -311,6 +313,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { 0, 0, 0, + 0, LWSMPRO_CALLBACK, /* origin points to a callback */ 9, /* strlen("/formtest"), ie length of the mountpoint */ NULL, @@ -329,6 +332,7 @@ static const struct lws_http_mount mount_ziptest_uncomm = { /* .cache_reusable */ 0, /* .cache_revalidate */ 0, /* .cache_intermediaries */ 0, + /* .cache_no */ 0, /* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */ /* .mountpoint_len */ 1, /* char count */ /* .basic_auth_login_file */ NULL,