Avoid host reuse if proxy changes
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 4 Sep 2012 11:19:26 +0000 (13:19 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 4 Sep 2012 11:19:26 +0000 (13:19 +0200)
src/host.c

index 25fd04a..7af0c07 100644 (file)
@@ -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);