<?xml version="1.0"?>
-<!-- $Id: config.xml,v 1.12 2004-02-26 23:43:07 adam Exp $ -->
+<!-- $Id: config.xml,v 1.13 2004-02-27 00:42:57 adam Exp $ -->
<proxy>
<target name="bagel">
<url>indexdata.dk</url>
</target>
<target default="1" name="localhost">
<url>localhost:9999</url>
- <url>localhost:9998</url>
<target-timeout>300</target-timeout>
<client-timeout>180</client-timeout>
<keepalive/> <!-- keepalive enabled -->
* Copyright (c) 1998-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: proxy.h,v 1.40 2004-02-24 20:55:57 adam Exp $
+ * $Id: proxy.h,v 1.41 2004-02-27 00:42:57 adam Exp $
*/
#include <sys/time.h>
int m_copy;
int match_list(int v, const char *m);
int atoi_l(const char **cp);
-
};
class YAZ_EXPORT Yaz_RecordCache {
Z_ElementSetNames *mk_esn_from_schema(ODR o, const char *schema);
Z_ReferenceId *m_referenceId;
NMEM m_referenceId_mem;
+#define NO_SPARE_SOLARIS_FD 10
+ int m_lo_fd[NO_SPARE_SOLARIS_FD];
+ void low_socket_open();
+ void low_socket_close();
public:
Yaz_Proxy(IYaz_PDU_Observable *the_PDU_Observable,
Yaz_Proxy *parent = 0);
* Copyright (c) 1998-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-proxy.cpp,v 1.104 2004-02-26 23:43:07 adam Exp $
+ * $Id: yaz-proxy.cpp,v 1.105 2004-02-27 00:42:58 adam Exp $
*/
+#include <unistd.h>
#include <assert.h>
#include <time.h>
+#include <sys/types.h>
+#include <fcntl.h>
#include <yaz/srw.h>
#include <yaz/marcdisp.h>
m_s2z_packing = Z_SRW_recordPacking_string;
m_time_tv.tv_sec = 0;
m_time_tv.tv_usec = 0;
+ if (!m_parent)
+ low_socket_open();
}
Yaz_Proxy::~Yaz_Proxy()
odr_destroy(m_s2z_odr_init);
if (m_s2z_odr_search)
odr_destroy(m_s2z_odr_search);
+ if (!m_parent)
+ low_socket_close();
delete m_config;
}
yaz_log(LOG_LOG, "%sXSLT convert %d",
m_session_str, m_stylesheet_offset);
res = xsltApplyStylesheet(m_stylesheet_xsp, doc, 0);
+
if (res)
{
xmlChar *out_buf;
xmlFree(out_buf);
xmlFreeDoc(res);
}
+
xmlFreeDoc(doc);
}
}
&addinfo, &stylesheet_name, &m_schema);
if (stylesheet_name)
{
+ m_parent->low_socket_close();
+
if (m_stylesheet_xsp)
xsltFreeStylesheet(m_stylesheet_xsp);
+
m_stylesheet_xsp = xsltParseStylesheetFile((const xmlChar*)
stylesheet_name);
m_stylesheet_offset = 0;
xfree(stylesheet_name);
+
+ m_parent->low_socket_open();
}
if (err == -1)
{
&addinfo, &stylesheet_name, &m_schema);
if (stylesheet_name)
{
+ m_parent->low_socket_close();
+
if (m_stylesheet_xsp)
xsltFreeStylesheet(m_stylesheet_xsp);
+
m_stylesheet_xsp = xsltParseStylesheetFile((const xmlChar*)
stylesheet_name);
m_stylesheet_offset = 0;
xfree(stylesheet_name);
+
+ m_parent->low_socket_open();
}
if (err == -1)
{
}
}
+void Yaz_Proxy::low_socket_close()
+{
+ int i;
+ for (i = 0; i<NO_SPARE_SOLARIS_FD; i++)
+ if (m_lo_fd[i] >= 0)
+ ::close(m_lo_fd[i]);
+}
+
+void Yaz_Proxy::low_socket_open()
+{
+ int i;
+ for (i = 0; i<NO_SPARE_SOLARIS_FD; i++)
+ m_lo_fd[i] = open("/dev/null", O_RDONLY);
+}
+
int Yaz_Proxy::server(const char *addr)
{
int r = Yaz_Z_Assoc::server(addr);