host->connections = 0;
host->ipport = 0;
host->mutex = 0;
+ host->error = 0;
if (host_getaddrinfo(host, iochan_man))
{
tproxy = xmalloc (strlen(url) + 10); /* so we can add :port */
strcpy(tproxy, url);
- for (cp = tproxy; *cp; cp++)
+ if (!strncmp(tproxy, "http://", 7))
+ cp = tproxy + 7;
+ else if (!strncmp(tproxy, "https://", 8))
+ cp = tproxy + 8;
+ else
+ cp = tproxy;
+ for (; *cp; cp++)
if (strchr("/?#~", *cp))
{
*cp = '\0';
hosts->hosts = p;
}
}
+ if (p && p->error) /* already resolved error */
+ p = 0;
yaz_mutex_leave(hosts->mutex);
xfree(tproxy);
return p;