From 585e68a16644a099c744ede6606b9d132ac9604c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 19 Jan 2006 01:56:55 +0000 Subject: use "Listen" instead of "Port" directive to determine a valid port git-svn-id: file:///home/lennart/svn/public/mod_dnssd/trunk@12 634eccf8-0006-0410-930e-e16565b0b7de --- src/mod_dnssd.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mod_dnssd.c b/src/mod_dnssd.c index 96206b9..01e87d8 100644 --- a/src/mod_dnssd.c +++ b/src/mod_dnssd.c @@ -141,9 +141,20 @@ 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, "Port") == 0) - default_port = (uint16_t) atoi(ap_getword_conf(t, &a)); - else if (strcasecmp(v->directive, "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, "services; - if ((colon = strchr(v->args, ':'))) + if ((colon = strrchr(v->args, ':'))) port = (uint8_t) atoi(colon+1); /* ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->main_server, "VHOST: %s ", v->directive); */ @@ -163,8 +174,6 @@ static void assemble_services(struct runtime_data *r) { if (strcasecmp(l->directive, "ServerName") == 0) host_name = ap_getword_conf(t, &a); - else if (strcasecmp(l->directive, "Port") == 0) - port = (uint16_t) atoi(ap_getword_conf(t, &a)); else if (strcasecmp(l->directive, "DNSSDServiceName") == 0) vname = ap_getword_conf(t, &a); else if (strcasecmp(l->directive, "DNSSDServiceTypes") == 0) -- cgit