projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix rpn2cql fails for Bib-1 set in qry+conf YAZ-865
[yaz-moved-to-github.git]
/
src
/
statserv.c
diff --git
a/src/statserv.c
b/src/statserv.c
index
b43dcac
..
815b2e9
100644
(file)
--- a/
src/statserv.c
+++ b/
src/statserv.c
@@
-226,6
+226,7
@@
static struct gfs_server * gfs_server_new(const char *id)
n->directory = 0;
n->docpath = 0;
n->stylesheet = 0;
n->directory = 0;
n->docpath = 0;
n->stylesheet = 0;
+ n->client_query_charset = 0;
n->id = nmem_strdup_null(gfs_nmem, id);
n->retrieval = yaz_retrieval_create();
return n;
n->id = nmem_strdup_null(gfs_nmem, id);
n->retrieval = yaz_retrieval_create();
return n;
@@
-490,6
+491,12
@@
static void xml_config_read(const char *base_path)
nmem_malloc(gfs_nmem, strlen(s) + 2);
sprintf(gfs->stylesheet, "/%s", s);
}
nmem_malloc(gfs_nmem, strlen(s) + 2);
sprintf(gfs->stylesheet, "/%s", s);
}
+ else if (!strcmp((const char *) ptr->name,
+ "client_query_charset"))
+ {
+ gfs->client_query_charset =
+ nmem_dup_xml_content(gfs_nmem, ptr->children);
+ }
else if (!strcmp((const char *) ptr->name, "explain"))
{
; /* being processed separately */
else if (!strcmp((const char *) ptr->name, "explain"))
{
; /* being processed separately */
@@
-832,7
+839,7
@@
static void statserv_closedown()
void __cdecl event_loop_thread(IOCHAN iochan)
{
void __cdecl event_loop_thread(IOCHAN iochan)
{
- iochan_event_loop(&iochan);
+ iochan_event_loop(&iochan, 0);
}
/* WIN32 listener */
}
/* WIN32 listener */
@@
-1080,7
+1087,7
@@
static void *new_session(void *vp)
control_block.one_shot = 1;
if (control_block.threads)
{
control_block.one_shot = 1;
if (control_block.threads)
{
- iochan_event_loop(&new_chan);
+ iochan_event_loop(&new_chan, 0);
}
else
{
}
else
{
@@
-1247,20
+1254,21
@@
static void statserv_reset(void)
{
}
{
}
-static void daemon_handler(void *data)
-{
- IOCHAN *pListener = data;
- iochan_event_loop(pListener);
-}
+static int sig_received = 0;
#ifndef WIN32
static void normal_stop_handler(int num)
{
#ifndef WIN32
static void normal_stop_handler(int num)
{
- yaz_log(log_server, "Received SIGTERM. PID=%ld", (long) getpid());
- exit(0);
+ sig_received = num;
}
#endif
}
#endif
+static void daemon_handler(void *data)
+{
+ IOCHAN *pListener = data;
+ iochan_event_loop(pListener, &sig_received);
+}
+
static void show_version(void)
{
char vstr[20], sha1_str[41];
static void show_version(void)
{
char vstr[20], sha1_str[41];
@@
-1335,6
+1343,10
@@
static int statserv_sc_main(yaz_sc_t s, int argc, char **argv)
daemon_handler, &pListener,
*control_block.pid_fname ? control_block.pid_fname : 0,
*control_block.setuid ? control_block.setuid : 0);
daemon_handler, &pListener,
*control_block.pid_fname ? control_block.pid_fname : 0,
*control_block.setuid ? control_block.setuid : 0);
+#ifndef WIN32
+ if (sig_received)
+ yaz_log(YLOG_LOG, "Received SIGTERM PID=%ld", (long) getpid());
+#endif
return 0;
}
return 0;
}