projects
/
yazpp-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
50fbcf2
)
Better reporting of statistics. Handling of ODR decode improved
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 20 Oct 2003 18:31:43 +0000
(18:31 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 20 Oct 2003 18:31:43 +0000
(18:31 +0000)
include/yaz++/proxy.h
patch
|
blob
|
history
src/config.xml
patch
|
blob
|
history
src/yaz-pdu-assoc.cpp
patch
|
blob
|
history
src/yaz-proxy-config.cpp
patch
|
blob
|
history
src/yaz-proxy.cpp
patch
|
blob
|
history
src/yaz-z-assoc.cpp
patch
|
blob
|
history
diff --git
a/include/yaz++/proxy.h
b/include/yaz++/proxy.h
index
be82f31
..
78ecf4c
100644
(file)
--- a/
include/yaz++/proxy.h
+++ b/
include/yaz++/proxy.h
@@
-2,7
+2,7
@@
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
* 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>
*/
#include <yaz++/z-assoc.h>
@@
-59,7
+59,7
@@
public:
private:
void operator=(const Yaz_ProxyConfig &conf);
#if HAVE_XML2
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,
xmlDocPtr m_docPtr;
xmlNodePtr m_proxyPtr;
void return_target_info(xmlNodePtr ptr, const char **url,
diff --git
a/src/config.xml
b/src/config.xml
index
4d4b08e
..
b07af96
100644
(file)
--- a/
src/config.xml
+++ b/
src/config.xml
@@
-1,10
+1,10
@@
<?xml version="1.0"?>
<?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 -->
<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>
<keepalive>
<bandwidth>500000</bandwidth>
<pdu>500</pdu>
@@
-16,12
+16,12
@@
</limit>
<attribute type="1" value="1-11,13-1010"/>
<attribute type="1" value="*" error="114"/>
</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"/>
<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>
</target>
<target name="localhost">
<url>localhost:9999</url>
@@
-38,7
+38,7
@@
<syntax type="grs1"/>
<syntax type="xml" marcxml="1"/>
<syntax type="*" error="238"/>
<syntax type="grs1"/>
<syntax type="xml" marcxml="1"/>
<syntax type="*" error="238"/>
- <preinit>2</preinit>
+ <preinit>0</preinit>
</target>
<target name="*">
<!-- everything else -->
</target>
<target name="*">
<!-- everything else -->
diff --git
a/src/yaz-pdu-assoc.cpp
b/src/yaz-pdu-assoc.cpp
index
2eec370
..
aa149d6
100644
(file)
--- a/
src/yaz-pdu-assoc.cpp
+++ b/
src/yaz-pdu-assoc.cpp
@@
-2,7
+2,7
@@
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
* 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>
*/
#include <assert.h>
@@
-210,9
+210,9
@@
void Yaz_PDU_Assoc::socketNotify(int event)
return;
m_PDU_Observer->recv_PDU(m_input_buf, res);
return;
m_PDU_Observer->recv_PDU(m_input_buf, res);
- m_destroyed = 0;
if (destroyed) // it really was destroyed, return now.
return;
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)
{
} while (m_cs && cs_more (m_cs));
if (m_cs && m_state == Ready)
{
diff --git
a/src/yaz-proxy-config.cpp
b/src/yaz-proxy-config.cpp
index
9306899
..
1e75fde
100644
(file)
--- a/
src/yaz-proxy-config.cpp
+++ b/
src/yaz-proxy-config.cpp
@@
-2,7
+2,7
@@
* Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
* 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>
*/
#include <ctype.h>
@@
-283,7
+283,6
@@
int Yaz_ProxyConfig::check_type_1_structure(ODR odr, xmlNodePtr ptr,
Z_RPNStructure *q,
char **addinfo)
{
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);
if (q->which == Z_RPNStructure_complex)
{
int e = check_type_1_structure(odr, ptr, q->u.complex->s1, addinfo);
@@
-497,7
+496,7
@@
int Yaz_ProxyConfig::get_target_no(int no,
return 0;
}
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;
{
if (len == strlen(item) && memcmp(hay, item, len) == 0)
return 1;
diff --git
a/src/yaz-proxy.cpp
b/src/yaz-proxy.cpp
index
5f323b7
..
996f258
100644
(file)
--- 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.
*
* 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>
*/
#include <assert.h>
@@
-258,6
+258,11
@@
Yaz_ProxyClient *Yaz_Proxy::get_client(Z_APDU *apdu)
Yaz_ProxyConfig *cfg = check_reconfigure();
if (proxy_host)
{
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;
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;
{
Yaz_ProxyClient *c;
int spare = 0;
+ int in_use = 0;
+ int other = 0;
for (c = m_clientPool; c; c = c->m_next)
{
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,
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);
if (spare < pre_init)
{
c = new Yaz_ProxyClient(m_PDU_Observable->clone(), this);
diff --git
a/src/yaz-z-assoc.cpp
b/src/yaz-z-assoc.cpp
index
08e1976
..
bb696ce
100644
(file)
--- a/
src/yaz-z-assoc.cpp
+++ b/
src/yaz-z-assoc.cpp
@@
-1,8
+1,8
@@
/*
/*
- * Copyright (c) 1998-2001, Index Data.
+ * Copyright (c) 1998-2003, Index Data.
* See the file LICENSE for details.
*
* 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>
*/
#include <assert.h>
@@
-63,6
+63,7
@@
int Yaz_Z_Assoc::set_APDU_yazlog(int v)
{
int old = m_APDU_yazlog;
m_APDU_yazlog = v;
{
int old = m_APDU_yazlog;
m_APDU_yazlog = v;
+ return old;
}
const char *Yaz_Z_Assoc::get_APDU_log()
}
const char *Yaz_Z_Assoc::get_APDU_log()
@@
-92,6
+93,7
@@
void Yaz_Z_Assoc::recv_PDU(const char *buf, int len)
else
{
close();
else
{
close();
+ failNotify();
}
}
}
}