From 7d569f1b611c3b0b0317b23c5c2e2e75b11a40ce Mon Sep 17 00:00:00 2001 From: hno <> Date: Thu, 14 Dec 2006 08:36:01 +0000 Subject: [PATCH] wccp2_router config fixes. Should not need to specify the port. in fact the port is currently ignored completely, but the config type (sockaddr_in_list) did not understand host specifications alone only port or host:port). Now sockaddr_in_list supports port, host:port and host. Fully numeric host names without domain is not supported. --- src/cache_cf.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cache_cf.cc b/src/cache_cf.cc index e137b429e1..42276b690e 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.501 2006/10/08 13:10:34 serassio Exp $ + * $Id: cache_cf.cc,v 1.502 2006/12/14 01:36:01 hno Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -2583,6 +2583,7 @@ parse_sockaddr_in_list_token(sockaddr_in_list ** head, char *token) { char *t; char *host; + char *tmp; const struct hostent *hp; unsigned short port; @@ -2599,10 +2600,11 @@ parse_sockaddr_in_list_token(sockaddr_in_list ** head, char *token) if (0 == port) self_destruct(); - } else if ((port = xatoi(token)) > 0) { + } else if ((port = strtol(token, &tmp, 10)), !*tmp) { /* port */ } else { - self_destruct(); + host = token; + port = 0; } s = static_cast(xcalloc(1, sizeof(*s))); -- 2.47.3