Skip to content

Commit

Permalink
Merge pull request #281 from jajik/issue-278
Browse files Browse the repository at this point in the history
Simplify and fix CONFIG parameters handling
  • Loading branch information
jajik authored Sep 27, 2024
2 parents a27c692 + 4c442d1 commit 0ccb227
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit 0ccb227

Please sign in to comment.