X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fyaz-proxy-main.cpp;h=aa6b7c0a8cea22aab35a0b7a46eaa6386df1b91c;hb=77e4d83cc9e1d55c7d47c80b33f3b04125ae8c15;hp=01209d35d0714d79182704a4c6bd1418752a7216;hpb=d7f41f16caf965adb1a5ffcdaa937787dfcc030a;p=yazproxy-moved-to-github.git diff --git a/src/yaz-proxy-main.cpp b/src/yaz-proxy-main.cpp index 01209d3..aa6b7c0 100644 --- a/src/yaz-proxy-main.cpp +++ b/src/yaz-proxy-main.cpp @@ -1,7 +1,7 @@ -/* $Id: yaz-proxy-main.cpp,v 1.16 2005-06-25 15:58:33 adam Exp $ - Copyright (c) 1998-2005, Index Data. +/* $Id: yaz-proxy-main.cpp,v 1.21 2007-10-08 11:47:21 adam Exp $ + Copyright (c) 1998-2006, Index Data. -This file is part of the yaz-proxy. +This file is part of the yazproxy. YAZ proxy is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -45,23 +45,29 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#include -#include +#include +#include #include -#if HAVE_XSLT +#if YAZ_HAVE_XSLT #include #include #include #include #endif +#if YAZ_HAVE_EXSLT +#include +#endif + using namespace yazpp_1; void usage(char *prog) { - fprintf (stderr, "%s: [-c config] [-l log] [-a log] [-v level] [-t target] " - "[-u uid] [-p pidfile] @:port\n", prog); + fprintf (stderr, "%s: [-a log] [-c config]\n" + " [-i sec] [-l log] [-m num] [-n num] [-p pidfile]" + " [-t target] [-T sec] [-u uid]\n" + " [-v level] [-X] @:port\n", prog); exit (1); } @@ -92,6 +98,9 @@ int args(Yaz_Proxy *proxy, int argc, char **argv) } addr = arg; break; + case 'a': + proxy->set_APDU_log(arg); + break; case 'c': err = proxy->set_config(arg); if (err == -2) @@ -105,17 +114,8 @@ int args(Yaz_Proxy *proxy, int argc, char **argv) exit(1); } break; - case 'a': - proxy->set_APDU_log(arg); - break; - case 't': - proxy->set_default_target(arg); - break; - case 'o': - proxy->option("optimize", arg); - break; - case 'v': - yaz_log_init_level (yaz_log_mask_str(arg)); + case 'i': + proxy->set_client_idletime(atoi(arg)); break; case 'l': yaz_log_init_file (arg); @@ -124,27 +124,33 @@ int args(Yaz_Proxy *proxy, int argc, char **argv) case 'm': proxy->set_max_clients(atoi(arg)); break; - case 'i': - proxy->set_client_idletime(atoi(arg)); - break; - case 'T': - proxy->set_target_idletime(atoi(arg)); - break; case 'n': no_limit_files = atoi(arg); break; - case 'X': - proxy->set_debug_mode(1); - debug = 1; + case 'o': + proxy->option("optimize", arg); break; case 'p': if (!pid_fname) pid_fname = xstrdup(arg); break; + case 't': + proxy->set_default_target(arg); + break; + case 'T': + proxy->set_target_idletime(atoi(arg)); + break; case 'u': if (!uid) uid = xstrdup(arg); break; + case 'v': + yaz_log_init_level (yaz_log_mask_str(arg)); + break; + case 'X': + proxy->set_debug_mode(1); + debug = 1; + break; default: usage(prog); return 1; @@ -177,7 +183,7 @@ static void sighup_handler(int num) static_yaz_proxy->reconfig(); } -#if HAVE_XSLT +#if YAZ_HAVE_XSLT static void proxy_xml_error_handler(void *ctx, const char *fmt, ...) { char buf[1024]; @@ -203,10 +209,14 @@ static void child_run(SocketManager *m, int run) signal(SIGHUP, sighup_handler); #endif -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlSetGenericErrorFunc((void *) "XML", proxy_xml_error_handler); xsltSetGenericErrorFunc((void *) "XSLT", proxy_xml_error_handler); #endif + +#if YAZ_HAVE_EXSLT + exsltRegisterAll(); +#endif #ifdef WIN32 #else yaz_log(YLOG_LOG, "0 proxy run=%d pid=%ld", run, (long) getpid()); @@ -277,7 +287,7 @@ static void child_run(SocketManager *m, int run) int main(int argc, char **argv) { -#if HAVE_XSLT +#if YAZ_HAVE_XSLT xmlInitMemory(); LIBXML_TEST_VERSION