X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhost.c;h=ae536c61f6d29dd940dae957c1887df76ab55796;hb=0bb0ee0e00d750808e228b991c78cb4838bc989d;hp=57c6eb6836b8056a1083df977c9eda87f730eee7;hpb=7b13bb9165493bdef71e929ebcdc02b6a6605aca;p=pazpar2-moved-to-github.git diff --git a/src/host.c b/src/host.c index 57c6eb6..ae536c6 100644 --- a/src/host.c +++ b/src/host.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2011 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);