summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2006-01-19 01:56:55 +0000
committerLennart Poettering <lennart@poettering.net>2006-01-19 01:56:55 +0000
commit585e68a16644a099c744ede6606b9d132ac9604c (patch)
tree4b8092045d961ff693a97b5f7088ed8d10d2eb1b /src
parent56b9485f26d6811e9afe9e45ccecd5bfeb33c1a7 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/mod_dnssd.c21
1 files changed, 15 insertions, 6 deletions
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, "<VirtualHost") == 0) {
+ 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, "<VirtualHost") == 0) {
const char *host_name = NULL;
uint16_t port = 0;
const char *vname = NULL, *vtypes = NULL;
@@ -151,7 +162,7 @@ static void assemble_services(struct runtime_data *r) {
char *colon;
struct service_data *marker = r->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)