Skip to content

Commit 4d6d25e

Browse files
committed
Set default connection endpoint for redirection io
1 parent 5f1e88e commit 4d6d25e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Diff for: src/mod_redirectionio.c

+9-4
Original file line numberDiff line numberDiff line change
@@ -508,10 +508,11 @@ static void *create_redirectionio_dir_conf(apr_pool_t *pool, char *context) {
508508
if (config) {
509509
config->enable = -1;
510510
config->enable_logs = -1;
511-
config->server = NULL;
512511
config->project_key = NULL;
513-
config->protocol = -1;
514-
config->port = -1;
512+
config->protocol = TCP;
513+
config->port = 10301;
514+
config->server = "127.0.0.1";
515+
config->pass_set = -1;
515516
}
516517

517518
return config;
@@ -541,14 +542,16 @@ static void *merge_redirectionio_dir_conf(apr_pool_t *pool, void *parent, void *
541542
conf->project_key = conf_current->project_key;
542543
}
543544

544-
if (conf_current->server == NULL) {
545+
if (conf_current->pass_set == -1) {
545546
conf->port = conf_parent->port;
546547
conf->protocol = conf_parent->protocol;
547548
conf->server = conf_parent->server;
549+
conf->pass_set = conf_parent->pass_set;
548550
} else {
549551
conf->port = conf_current->port;
550552
conf->protocol = conf_current->protocol;
551553
conf->server = conf_current->server;
554+
conf->pass_set = conf_current->pass_set;
552555
}
553556

554557
if (apr_reslist_create(
@@ -686,6 +689,8 @@ static const char *redirectionio_set_pass(cmd_parms *cmd, void *cfg, const char
686689
return NULL;
687690
}
688691

692+
conf->pass_set = 1;
693+
689694
if (uri.scheme != NULL && apr_strnatcmp(uri.scheme, "unix") == 0) {
690695
conf->protocol = UNIX;
691696
}

Diff for: src/mod_redirectionio.h

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ typedef struct {
3131
int protocol;
3232
int enable;
3333
int enable_logs;
34+
int pass_set;
3435
apr_reslist_t *connection_pool;
3536
} redirectionio_config;
3637

0 commit comments

Comments
 (0)