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.
/*
- * $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
{
char *t;
char *host;
+ char *tmp;
const struct hostent *hp;
unsigned short port;
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<sockaddr_in_list *>(xcalloc(1, sizeof(*s)));