* NT threaded server code by
* Chas Woodfield, Fretwell Downing Informatics.
*
- * $Id: statserv.c,v 1.37 2006-05-07 14:48:25 adam Exp $
+ * $Id: statserv.c,v 1.40 2006-07-07 13:02:21 marc Exp $
*/
/**
#include <pwd.h>
#endif
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xinclude.h>
static int max_sessions = 0;
static int logbits_set = 0;
-static int log_session = 0;
+static int log_session = 0; /* one-line logs for session */
+static int log_sessiondetail = 0; /* more detailed stuff */
static int log_server = 0;
/** get_logbits sets global loglevel bits */
{
logbits_set = 1;
log_session = yaz_log_module_level("session");
+ log_sessiondetail = yaz_log_module_level("sessiondetail");
log_server = yaz_log_module_level("server");
}
}
static int add_listener(char *where, int listen_id);
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
static xmlDocPtr xml_config_doc = 0;
#endif
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
static xmlNodePtr xml_config_get_root()
{
xmlNodePtr ptr = 0;
}
#endif
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
static char *nmem_dup_xml_content(NMEM n, xmlNodePtr ptr)
{
unsigned char *cp;
n->directory = 0;
n->docpath = 0;
n->stylesheet = 0;
-#if HAVE_XSLT
+#if YAZ_HAVE_XML2
n->retrieval = yaz_retrieval_create();
#endif
return n;
{
struct gfs_server **gfsp = &gfs_server_list;
struct gfs_listen **gfslp = &gfs_listen_list;
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
xmlNodePtr ptr = xml_config_get_root();
if (!ptr)
#endif
gfs_nmem = nmem_create();
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
if (control_block.xml_config[0] == '\0')
return;
static void xml_config_close()
{
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
if (xml_config_doc)
{
xmlFreeDoc(xml_config_doc);
return;
}
- yaz_log(log_session, "Connect from %s", cs_addrstr(new_line));
+ yaz_log(log_sessiondetail, "Connect from %s", cs_addrstr(new_line));
no_sessions++;
if (control_block.dynamic)
#else
a = 0;
#endif
- yaz_log(log_session, "Starting session %d from %s (pid=%ld)",
+ yaz_log(log_session, "Session - OK %d %s %ld",
no_sessions, a ? a : "[Unknown]", (long) getpid());
if (max_sessions && no_sessions >= max_sessions)
control_block.one_shot = 1;
iochan_setdata(chan, assoc);
iochan_settimeout(chan, 60);
addr = cs_addrstr(line);
- yaz_log(log_session, "Inetd association from %s",
+ yaz_log(log_sessiondetail, "Inetd association from %s",
addr ? addr : "[UNKNOWN]");
assoc->cs_get_mask = EVENT_INPUT;
}
option_copy(control_block.pid_fname, arg);
break;
case 'f':
-#if HAVE_XML2
+#if YAZ_HAVE_XML2
option_copy(control_block.xml_config, arg);
#else
fprintf(stderr, "%s: Option -f unsupported since YAZ is compiled without Libxml2 support\n", me);