* Copyright (c) 1998-2004, Index Data.
* See the file LICENSE for details.
*
- * $Id: yaz-proxy-main.cpp,v 1.30 2004-01-12 22:35:26 adam Exp $
+ * $Id: yaz-proxy-main.cpp,v 1.32 2004-02-10 15:02:19 adam Exp $
*/
#include <signal.h>
#include <unistd.h>
#include <pwd.h>
#include <sys/types.h>
+#include <stdarg.h>
#include <yaz/log.h>
#include <yaz/options.h>
static_yaz_proxy->reconfig();
}
+#if HAVE_XSLT
+static void proxy_xml_error_handler(void *ctx, const char *fmt, ...)
+{
+ char buf[1024];
+
+ va_list ap;
+ va_start(ap, fmt);
+
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+
+ yaz_log(LOG_WARN, "%s", buf);
+
+ va_end (ap);
+}
+#endif
static void child_run(Yaz_SocketManager *m, int run)
{
signal(SIGHUP, sighup_handler);
+#if HAVE_XSLT
+ xmlSetGenericErrorFunc(0, proxy_xml_error_handler);
+#endif
yaz_log(LOG_LOG, "0 proxy run=%d pid=%ld", run, (long) getpid());
if (pid_fname)
{
yaz_log(LOG_WARN, "Received SIGSEGV from child %ld", (long) p);
cont = 1;
break;
+ case SIGBUS:
+ yaz_log(LOG_WARN, "Received SIGBUS from child %ld", (long) p);
+ cont = 1;
+ break;
case SIGTERM:
yaz_log(LOG_LOG, "Received SIGTERM from child %ld",
(long) p);
cont = 1;
}
if (cont)
- sleep(1);
+ sleep(1 + run/5);
run++;
}
exit (0);