1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

lejp-conf: provide matches for block start paths

Also valgrind shows we should zero down the lejp context to avoid problems
with the wildcard stack
This commit is contained in:
Andy Green 2022-02-09 15:04:12 +00:00
parent 1b70ae9296
commit 32698a2f4b
2 changed files with 15 additions and 3 deletions

View file

@ -161,7 +161,7 @@ lejp_check_path_match(struct lejp_ctx *ctx)
p = ctx->path;
q = *((char **)(((char *)ctx->pst[ctx->pst_sp].paths) + ((unsigned int)n * s)));
//lwsl_notice("%s: %s %s\n", __func__, p, q);
while (*p && *q) {
if (*q != '*') {
if (*p != *q)

View file

@ -71,7 +71,6 @@ enum lejp_global_paths {
static const char * const paths_vhosts[] = {
"vhosts[]",
"vhosts[].mounts[]",
"vhosts[].name",
"vhosts[].port",
"vhosts[].interface",
@ -89,6 +88,7 @@ static const char * const paths_vhosts[] = {
"vhosts[].mounts[].auth-mask",
"vhosts[].mounts[].cgi-timeout",
"vhosts[].mounts[].cgi-env[].*",
"vhosts[].mounts[].cgi-env[]",
"vhosts[].mounts[].cache-max-age",
"vhosts[].mounts[].cache-reuse",
"vhosts[].mounts[].cache-revalidate",
@ -96,7 +96,10 @@ static const char * const paths_vhosts[] = {
"vhosts[].mounts[].basic-auth",
"vhosts[].mounts[].cache-intermediaries",
"vhosts[].mounts[].extra-mimetypes.*",
"vhosts[].mounts[].extra-mimetypes",
"vhosts[].mounts[].interpret.*",
"vhosts[].mounts[].interpret",
"vhosts[].mounts[]",
"vhosts[].ws-protocols[].*.*",
"vhosts[].ws-protocols[].*",
"vhosts[].ws-protocols[]",
@ -109,6 +112,7 @@ static const char * const paths_vhosts[] = {
"vhosts[].ssl-option-set",
"vhosts[].ssl-option-clear",
"vhosts[].mounts[].pmo[].*",
"vhosts[].mounts[].pmo[]",
"vhosts[].headers[].*",
"vhosts[].headers[]",
"vhosts[].client-ssl-key",
@ -141,7 +145,6 @@ static const char * const paths_vhosts[] = {
enum lejp_vhost_paths {
LEJPVP,
LEJPVP_MOUNTS,
LEJPVP_NAME,
LEJPVP_PORT,
LEJPVP_INTERFACE,
@ -159,6 +162,7 @@ enum lejp_vhost_paths {
LEJPVP_DEFAULT_AUTH_MASK,
LEJPVP_CGI_TIMEOUT,
LEJPVP_CGI_ENV,
LEJPVP_CGI_ENV_base,
LEJPVP_MOUNT_CACHE_MAX_AGE,
LEJPVP_MOUNT_CACHE_REUSE,
LEJPVP_MOUNT_CACHE_REVALIDATE,
@ -166,7 +170,12 @@ enum lejp_vhost_paths {
LEJPVP_MOUNT_BASIC_AUTH,
LEJPVP_MOUNT_CACHE_INTERMEDIARIES,
LEJPVP_MOUNT_EXTRA_MIMETYPES,
LEJPVP_MOUNT_EXTRA_MIMETYPES_base,
LEJPVP_MOUNT_INTERPRET,
LEJPVP_MOUNT_INTERPRET_base,
LEJPVP_MOUNTS,
LEJPVP_PROTOCOL_NAME_OPT,
LEJPVP_PROTOCOL_NAME,
LEJPVP_PROTOCOL,
@ -179,6 +188,7 @@ enum lejp_vhost_paths {
LEJPVP_SSL_OPTION_SET,
LEJPVP_SSL_OPTION_CLEAR,
LEJPVP_PMO,
LEJPVP_PM_baseO,
LEJPVP_HEADERS_NAME,
LEJPVP_HEADERS,
LEJPVP_CLIENT_SSL_KEY,
@ -942,6 +952,8 @@ lwsws_get_config(void *user, const char *f, const char * const *paths,
struct lejp_ctx ctx;
int n, m = 0, fd;
memset(&ctx, 0, sizeof(ctx));
fd = lws_open(f, O_RDONLY);
if (fd < 0) {
lwsl_err("Cannot open %s\n", f);