mirror of
https://libwebsockets.org/repo/libwebsockets
synced 2025-05-08 01:30:53 +00:00
lws_http_mount: Add support for chroot and chdir in CGI mounts
All examples have been updated to provide NULL for these new fields.
This commit is contained in:
parent
e351d0c348
commit
2cd0d9ed78
42 changed files with 124 additions and 0 deletions
include/libwebsockets
lib/roles/http/server
minimal-examples-lowlevel
client-server/minimal-ws-proxy
http-server
minimal-http-server-basicauth
minimal-http-server-cgi
minimal-http-server-custom-headers
minimal-http-server-deaddrop
minimal-http-server-dynamic
minimal-http-server-eventlib-custom
minimal-http-server-eventlib-demos
minimal-http-server-eventlib-foreign
minimal-http-server-eventlib-smp
minimal-http-server-eventlib
minimal-http-server-form-get
minimal-http-server-form-post-file
minimal-http-server-form-post-lwsac
minimal-http-server-form-post
minimal-http-server-fulltext-search
minimal-http-server-mimetypes
minimal-http-server-multivhost
minimal-http-server-proxy
minimal-http-server-smp
minimal-http-server-sse-ring
minimal-http-server-sse
minimal-http-server-tls-80
minimal-http-server-tls-mem
minimal-http-server-tls
raw
minimal-raw-fallback-http-server
minimal-raw-proxy-fallback
ws-server
minimal-ws-broker
minimal-ws-raw-proxy
minimal-ws-server-pmd-bulk
minimal-ws-server-pmd-corner
minimal-ws-server-pmd
minimal-ws-server-ring
minimal-ws-server-threadpool
minimal-ws-server-threads-foreign-libuv-smp
minimal-ws-server-threads-smp
minimal-ws-server-threads
minimal-ws-server-timer
minimal-ws-server
test-apps
|
@ -1382,6 +1382,14 @@ struct lws_http_mount {
|
|||
const char *basic_auth_login_file;
|
||||
/**<NULL, or filepath to use to check basic auth logins against. (requires LWSAUTHM_DEFAULT) */
|
||||
|
||||
const char *cgi_chroot_path;
|
||||
/**< NULL, or chroot patch for child cgi process */
|
||||
|
||||
const char *cgi_wd;
|
||||
/**< working directory to cd to after fork of a cgi process,
|
||||
* NULL defaults to /tmp
|
||||
*/
|
||||
|
||||
/* Add new things just above here ---^
|
||||
* This is part of the ABI, don't needlessly break compatibility
|
||||
*/
|
||||
|
|
|
@ -1974,6 +1974,8 @@ lws_http_action(struct lws *wsi)
|
|||
cgiinfo.script_uri_path_len = hit->mountpoint_len;
|
||||
cgiinfo.timeout_secs = (int)n;
|
||||
cgiinfo.mp_cgienv = hit->cgienv;
|
||||
cgiinfo.chroot_path = hit->cgi_chroot_path;
|
||||
cgiinfo.wd = hit->cgi_wd;
|
||||
|
||||
n = (unsigned int)lws_cgi_via_info(&cgiinfo);
|
||||
if (n) {
|
||||
|
|
|
@ -51,6 +51,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -43,6 +43,8 @@ static const struct lws_http_mount mount_secret = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* dynamic */
|
||||
/* .mountpoint_len */ 7, /* char count */
|
||||
/* .basic_auth_login_file */ "./ba-passwords",
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* default mount serves the URL space from ./mount-origin */
|
||||
|
@ -66,6 +68,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -39,6 +39,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_CGI, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -128,6 +128,8 @@ static const struct lws_http_mount mount_dyn = {
|
|||
/* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */
|
||||
/* .mountpoint_len */ 4, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* default mount serves the URL space from ./mount-origin */
|
||||
|
@ -151,6 +153,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -64,6 +64,8 @@ static const struct lws_http_mount mount_upload = {
|
|||
/* .origin_protocol */ LWSMPRO_CALLBACK,
|
||||
/* .mountpoint_len */ 7, /* char count */
|
||||
/* .basic_auth_login_file */ "./ba-passwords",
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* wire up /get URLs to the upload directory (protected by basic auth) */
|
||||
|
@ -87,6 +89,8 @@ static const struct lws_http_mount mount_get = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* dynamic */
|
||||
/* .mountpoint_len */ 4, /* char count */
|
||||
/* .basic_auth_login_file */ "./ba-passwords",
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* wire up / to serve from ./mount-origin (protected by basic auth) */
|
||||
|
@ -110,6 +114,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ "./ba-passwords",
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* pass config options to the deaddrop plugin using pvos */
|
||||
|
|
|
@ -242,6 +242,8 @@ static const struct lws_http_mount mount_dyn = {
|
|||
/* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */
|
||||
/* .mountpoint_len */ 4, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* default mount serves the URL space from ./mount-origin */
|
||||
|
@ -265,6 +267,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -294,6 +294,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -60,6 +60,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
LWSMPRO_FILE, /* origin points to a callback */
|
||||
14, /* strlen("/ziptest"), ie length of the mountpoint */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
}, mount_ziptest = {
|
||||
(struct lws_http_mount *)&mount_ziptest_uncomm, /* linked-list pointer to next*/
|
||||
"/ziptest", /* mountpoint in URL namespace on this vhost */
|
||||
|
@ -79,6 +81,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
LWSMPRO_FILE, /* origin points to a callback */
|
||||
8, /* strlen("/ziptest"), ie length of the mountpoint */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
}, mount_post = {
|
||||
(struct lws_http_mount *)&mount_ziptest, /* linked-list pointer to next*/
|
||||
|
@ -99,6 +103,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
LWSMPRO_CALLBACK, /* origin points to a callback */
|
||||
9, /* strlen("/formtest"), ie length of the mountpoint */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
||||
}, mount = {
|
||||
/* .mount_next */ &mount_post, /* linked-list "next" */
|
||||
|
@ -119,6 +125,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void signal_cb(void *handle, int signum)
|
||||
|
|
|
@ -57,6 +57,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void
|
||||
|
|
|
@ -51,6 +51,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void *thread_service(void *threadid)
|
||||
|
|
|
@ -39,6 +39,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void signal_cb(void *handle, int signum)
|
||||
|
|
|
@ -98,6 +98,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -213,6 +213,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -165,6 +165,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -159,6 +159,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -59,6 +59,8 @@ static const struct lws_http_mount mount_fts = {
|
|||
/* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */
|
||||
/* .mountpoint_len */ 4, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
static const struct lws_http_mount mount = {
|
||||
|
@ -80,6 +82,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -45,6 +45,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -38,6 +38,8 @@ static const struct lws_http_mount mount_localhost1 = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
}, mount_localhost2 = {
|
||||
/* .mount_next */ NULL, /* linked-list "next" */
|
||||
/* .mountpoint */ "/", /* mountpoint URL */
|
||||
|
@ -57,6 +59,8 @@ static const struct lws_http_mount mount_localhost1 = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
}, mount_localhost3 = {
|
||||
/* .mount_next */ NULL, /* linked-list "next" */
|
||||
/* .mountpoint */ "/", /* mountpoint URL */
|
||||
|
@ -76,6 +80,8 @@ static const struct lws_http_mount mount_localhost1 = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -33,6 +33,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_HTTPS, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -53,6 +53,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void *thread_service(void *threadid)
|
||||
|
|
|
@ -332,6 +332,8 @@ static const struct lws_http_mount mount_sse = {
|
|||
/* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */
|
||||
/* .mountpoint_len */ 4, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* default mount serves the URL space from ./mount-origin */
|
||||
|
@ -355,6 +357,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -152,6 +152,8 @@ static const struct lws_http_mount mount_sse = {
|
|||
/* .origin_protocol */ LWSMPRO_CALLBACK, /* dynamic */
|
||||
/* .mountpoint_len */ 4, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* default mount serves the URL space from ./mount-origin */
|
||||
|
@ -175,6 +177,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -44,6 +44,8 @@ static const struct lws_http_mount mount80 = {
|
|||
/* .origin_protocol */ LWSMPRO_REDIR_HTTPS, /* https redir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
static const struct lws_http_mount mount = {
|
||||
|
@ -65,6 +67,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -41,6 +41,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/* the cert and key as PEM */
|
||||
|
|
|
@ -76,6 +76,8 @@ static const struct lws_http_mount
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
#if !defined(WIN32)
|
||||
|
|
|
@ -46,6 +46,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
static int
|
||||
|
|
|
@ -50,6 +50,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
static int interrupted;
|
||||
|
|
|
@ -48,6 +48,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -394,6 +394,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -70,6 +70,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
static const struct lws_extension extensions[] = {
|
||||
|
|
|
@ -47,6 +47,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
static const struct lws_extension extensions[] = {
|
||||
|
|
|
@ -47,6 +47,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
static const struct lws_extension extensions[] = {
|
||||
|
|
|
@ -48,6 +48,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -59,6 +59,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -65,6 +65,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -63,6 +63,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -59,6 +59,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -79,6 +79,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
void sigint_handler(int sig)
|
||||
|
|
|
@ -54,6 +54,8 @@ static const struct lws_http_mount mount = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
#if defined(LWS_WITH_PLUGINS)
|
||||
|
|
|
@ -280,6 +280,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
LWSMPRO_FILE, /* origin points to a callback */
|
||||
14, /* strlen("/ziptest"), ie length of the mountpoint */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
}, mount_ziptest = {
|
||||
(struct lws_http_mount *)&mount_ziptest_uncomm, /* linked-list pointer to next*/
|
||||
"/ziptest", /* mountpoint in URL namespace on this vhost */
|
||||
|
@ -299,6 +301,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
LWSMPRO_FILE, /* origin points to a callback */
|
||||
8, /* strlen("/ziptest"), ie length of the mountpoint */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
}, mount_post = {
|
||||
(struct lws_http_mount *)&mount_ziptest, /* linked-list pointer to next*/
|
||||
"/formtest", /* mountpoint in URL namespace on this vhost */
|
||||
|
@ -318,6 +322,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
LWSMPRO_CALLBACK, /* origin points to a callback */
|
||||
9, /* strlen("/formtest"), ie length of the mountpoint */
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
}, mount = {
|
||||
/* .mount_next */ &mount_post, /* linked-list "next" */
|
||||
/* .mountpoint */ "/", /* mountpoint URL */
|
||||
|
@ -337,6 +343,8 @@ static const struct lws_http_mount mount_ziptest_uncomm = {
|
|||
/* .origin_protocol */ LWSMPRO_FILE, /* files in a dir */
|
||||
/* .mountpoint_len */ 1, /* char count */
|
||||
/* .basic_auth_login_file */ NULL,
|
||||
/* .cgi_chroot_path */ NULL,
|
||||
/* .cgi_wd */ NULL,
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue