Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify and fix CONFIG parameters handling #281

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions native/mod_manager/mod_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,7 @@ static char **process_buff(request_rec *r, char *buff)

static apr_status_t insert_update_host_helper(server_rec *s, mem_t *mem, hostinfo_t *info, char *alias)
{
(void)s;
strncpy(info->host, alias, HOSTALIASZ);
info->host[HOSTALIASZ] = '\0';
return insert_update_host(mem, info);
Expand Down Expand Up @@ -797,6 +798,7 @@ static void read_remove_context(mem_t *mem, contextinfo_t *context)
static apr_status_t insert_update_context_helper(server_rec *s, mem_t *mem, contextinfo_t *info, char *context,
int status)
{
(void)s;
info->id = 0;
strncpy(info->context, context, CONTEXTSZ);
info->context[CONTEXTSZ] = '\0';
Expand Down Expand Up @@ -1247,7 +1249,7 @@ static char *process_context_alias(char *key, char *val, apr_pool_t *p, struct c
if (strcasecmp(key, "Alias") == 0) {
char *tmp;

if (phost->host && ((!phost->context && in_config) || !in_config)) {
if (phost->host && !in_config) {
*errtype = TYPESYNTAX;
return in_config ? SALIBAD : SMULALB;
}
Expand All @@ -1272,9 +1274,9 @@ static char *process_context_alias(char *key, char *val, apr_pool_t *p, struct c
}

if (strcasecmp(key, "Context") == 0) {
if (phost->context) {
if (phost->context && !in_config) {
*errtype = TYPESYNTAX;
return in_config ? SCONBAD : SMULCTB;
return SMULCTB;
}
if (check_context_alias_length(val, CONTEXTSZ)) {
*errtype = TYPESYNTAX;
Expand Down