summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-01-19 02:17:51 +0000
committerLennart Poettering <lennart@poettering.net>2006-01-19 02:17:51 +0000
commit2a6fb68515eff087df87bc1d4a6f29d7feabd272 (patch)
tree153b4f0ac7f7fe9c504b9575f9e9af1880a698d3 /src
parenta89026c79593c639178e2cfbb1f6ab44d3073a38 (diff)
fix parsing of "Listen" directive
git-svn-id: file:///home/lennart/svn/public/mod_dnssd/trunk@15 634eccf8-0006-0410-930e-e16565b0b7de
Diffstat (limited to 'src')
-rw-r--r--src/mod_dnssd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mod_dnssd.c b/src/mod_dnssd.c
index e51a65d..81bd5fc 100644
--- a/src/mod_dnssd.c
+++ b/src/mod_dnssd.c
@@ -128,7 +128,7 @@ static void add_service(struct runtime_data *r, const char *host_name, uint16_t
static void assemble_services(struct runtime_data *r) {
ap_directive_t *v;
const char *default_host_name = NULL;
- uint16_t default_port = 80;
+ uint16_t default_port = 0;
struct service_data *j;
apr_pool_t *t;
@@ -141,16 +141,17 @@ static void assemble_services(struct runtime_data *r) {
if (strcasecmp(v->directive, "ServerName") == 0)
default_host_name = ap_getword_conf(t, &a);
+
else if (strcasecmp(v->directive, "Listen") == 0) {
char *sp;
-
+
if (!default_port) {
char *colon;
sp = ap_getword_conf(t, &a);
if ((colon = strrchr(sp, ':')))
sp = colon + 1;
-
+
default_port = (uint16_t) atoi(sp);
}
} else if (strcasecmp(v->directive, "DNSSDServicePort") == 0)
@@ -270,6 +271,9 @@ static void assemble_services(struct runtime_data *r) {
apr_pool_destroy(p_loop);
}
+
+ if (!default_port)
+ default_port = 80;
/* Fill in missing data in all services */
for (j = r->services; j; j = j->next) {