X-Git-Url: http://git.indexdata.com/?p=yazpp-moved-to-github.git;a=blobdiff_plain;f=src%2Fyaz-proxy.cpp;h=996f258f6d225446942a8308f10be7c8fba48c20;hp=5f323b7343ecbcf710edd93cdad3329e01e495d6;hb=92c0519af66131a46fbb398ce037009be2e8d0c5;hpb=50fbcf20ab48480e819ec5aef312a72c684bf213 diff --git a/src/yaz-proxy.cpp b/src/yaz-proxy.cpp index 5f323b7..996f258 100644 --- a/src/yaz-proxy.cpp +++ b/src/yaz-proxy.cpp @@ -2,7 +2,7 @@ * Copyright (c) 1998-2003, Index Data. * See the file LICENSE for details. * - * $Id: yaz-proxy.cpp,v 1.62 2003-10-16 16:10:43 adam Exp $ + * $Id: yaz-proxy.cpp,v 1.63 2003-10-20 18:31:44 adam Exp $ */ #include @@ -258,6 +258,11 @@ Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu) Yaz_ProxyConfig *cfg = check_reconfigure(); if (proxy_host) { +#if 0 +/* only to be enabled for debugging... */ + if (!strcmp(proxy_host, "stop")) + exit(0); +#endif xfree(m_default_target); m_default_target = xstrdup(proxy_host); proxy_host = m_default_target; @@ -1321,15 +1326,26 @@ void Yaz_Proxy::pre_init() { Yaz_ProxyClient *c; int spare = 0; + int in_use = 0; + int other = 0; for (c = m_clientPool; c; c = c->m_next) { - if (!strcmp(zurl_in_use[j], c->get_hostname()) - && c->m_server == 0 && c->m_cookie == 0) - spare++; + if (!strcmp(zurl_in_use[j], c->get_hostname())) + { + if (c->m_cookie == 0) + { + if (c->m_server == 0) + spare++; + else + in_use++; + } + else + other++; + } } - yaz_log(LOG_LOG, "%s pre-init %s %s spare=%d pre_init=%d", + yaz_log(LOG_LOG, "%s pre-init %s %s use=%d other=%d spare=%d preinit=%d", m_session_str, - name, zurl_in_use[j], spare, pre_init); + name, zurl_in_use[j], in_use, other, spare, pre_init); if (spare < pre_init) { c = new Yaz_ProxyClient(m_PDU_Observable->clone(), this);