* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: proxy.h,v 1.19 2003-10-16 16:10:43 adam Exp $
+ * $Id: proxy.h,v 1.20 2003-10-20 18:31:43 adam Exp $
*/
#include <yaz++/z-assoc.h>
private:
void operator=(const Yaz_ProxyConfig &conf);
#if HAVE_XML2
- int mycmp(const char *hay, const char *item, int len);
+ int mycmp(const char *hay, const char *item, size_t len);
xmlDocPtr m_docPtr;
xmlNodePtr m_proxyPtr;
void return_target_info(xmlNodePtr ptr, const char **url,
<?xml version="1.0"?>
-<!-- $Id: config.xml,v 1.12 2003-10-16 16:10:43 adam Exp $ -->
+<!-- $Id: config.xml,v 1.13 2003-10-20 18:31:43 adam Exp $ -->
<proxy>
<target default="1" name="voyager">
<!-- default target -->
- <url>z3950.loc.gov:7090/voyager</url>
- <url>z3950.loc.gov:7094/voyager</url>
+ <url>z3950.loc.gov:7090</url>
+ <url>z3950.loc.gov:7094</url>
<keepalive>
<bandwidth>500000</bandwidth>
<pdu>500</pdu>
</limit>
<attribute type="1" value="1-11,13-1010"/>
<attribute type="1" value="*" error="114"/>
- <target-timeout>300</target-timeout>
+ <target-timeout>240</target-timeout>
<client-timeout>180</client-timeout>
<syntax type="usmarc"/>
<syntax type="xml" marcxml="1"/>
<syntax type="*" error="238"/>
- <preinit>0</preinit>
+ <preinit>2</preinit>
</target>
<target name="localhost">
<url>localhost:9999</url>
<syntax type="grs1"/>
<syntax type="xml" marcxml="1"/>
<syntax type="*" error="238"/>
- <preinit>2</preinit>
+ <preinit>0</preinit>
</target>
<target name="*">
<!-- everything else -->
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-pdu-assoc.cpp,v 1.34 2003-10-16 16:10:43 adam Exp $
+ * $Id: yaz-pdu-assoc.cpp,v 1.35 2003-10-20 18:31:44 adam Exp $
*/
#include <assert.h>
return;
m_PDU_Observer->recv_PDU(m_input_buf, res);
- m_destroyed = 0;
if (destroyed) // it really was destroyed, return now.
return;
+ m_destroyed = 0;
} while (m_cs && cs_more (m_cs));
if (m_cs && m_state == Ready)
{
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-proxy-config.cpp,v 1.11 2003-10-16 16:10:43 adam Exp $
+ * $Id: yaz-proxy-config.cpp,v 1.12 2003-10-20 18:31:44 adam Exp $
*/
#include <ctype.h>
Z_RPNStructure *q,
char **addinfo)
{
- int c;
if (q->which == Z_RPNStructure_complex)
{
int e = check_type_1_structure(odr, ptr, q->u.complex->s1, addinfo);
return 0;
}
-int Yaz_ProxyConfig::mycmp(const char *hay, const char *item, int len)
+int Yaz_ProxyConfig::mycmp(const char *hay, const char *item, size_t len)
{
if (len == strlen(item) && memcmp(hay, item, len) == 0)
return 1;
* 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 <assert.h>
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;
{
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);
/*
- * Copyright (c) 1998-2001, Index Data.
+ * Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-z-assoc.cpp,v 1.28 2003-10-16 16:10:43 adam Exp $
+ * $Id: yaz-z-assoc.cpp,v 1.29 2003-10-20 18:31:44 adam Exp $
*/
#include <assert.h>
{
int old = m_APDU_yazlog;
m_APDU_yazlog = v;
+ return old;
}
const char *Yaz_Z_Assoc::get_APDU_log()
else
{
close();
+ failNotify();
}
}