X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fhost.c;h=ae536c61f6d29dd940dae957c1887df76ab55796;hb=8b8116a8d0e10201f0bd56adba461d2bb9becc79;hp=25fd04ac323189523061651a1b8282fbb7a0c93f;hpb=c7ce18b91b4b542af4f02ad9fa3f86f12b92f3d1;p=pazpar2-moved-to-github.git diff --git a/src/host.c b/src/host.c index 25fd04a..ae536c6 100644 --- a/src/host.c +++ b/src/host.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2012 Index Data + Copyright (C) 2006-2013 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -55,7 +55,7 @@ static struct host *create_host(const char *url, const char *proxy, else { char *cp; - + host->tproxy = xmalloc (strlen(url) + 10); /* so we can add :port */ strcpy(host->tproxy, url); for (cp = host->tproxy; *cp; cp++) @@ -99,7 +99,12 @@ struct host *find_host(database_hosts_t hosts, const char *url, yaz_mutex_enter(hosts->mutex); for (p = hosts->hosts; p; p = p->next) if (!strcmp(p->url, url)) - break; + { + if (p->proxy && proxy && !strcmp(p->proxy, proxy)) + break; + if (!p->proxy && !proxy) + break; + } if (!p) { p = create_host(url, proxy, port, iochan_man);