/*
- * $Id: cache_cf.cc,v 1.171 1997/02/06 18:44:23 wessels Exp $
+ * $Id: cache_cf.cc,v 1.172 1997/02/19 17:05:21 wessels Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
SQUID_VERSION);
if (!Config.udpMaxHitObjsz || Config.udpMaxHitObjsz > SQUID_UDP_SO_SNDBUF)
Config.udpMaxHitObjsz = SQUID_UDP_SO_SNDBUF;
+ if (Config.appendDomain)
+ Config.appendDomainLen = strlen(Config.appendDomain);
+ else
+ Config.appendDomainLen = 0;
}
/*
- * $Id: url.cc,v 1.53 1997/02/19 00:03:48 wessels Exp $
+ * $Id: url.cc,v 1.54 1997/02/19 17:05:24 wessels Exp $
*
* DEBUG: section 23 URL Parsing
* AUTHOR: Duane Wessels
int l;
proto[0] = host[0] = urlpath[0] = login[0] = '\0';
- if ((l = strlen(url)) > (MAX_URL - 1)) {
+ if ((l = strlen(url)) + Config.appendDomainLen > (MAX_URL - 1)) {
/* terminate so it doesn't overflow other buffers */
*(url + (MAX_URL >> 1)) = '\0';
debug(23, 0, "urlParse: URL too large (%d bytes)\n", l);
/* remove trailing dots from hostnames */
while ((l = strlen(host)) && host[--l] == '.')
host[l] = '\0';
+ if (Config.appendDomain && !strchr(host, '.'))
+ strncat(host, Config.appendDomain, SQUIDHOSTNAMELEN);
if (port == 0) {
debug(23, 0, "urlParse: Invalid port == 0\n");
return NULL;