X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fstatserv.c;h=7560058b4c75180d26c0d0e3319100c0cfca2a50;hb=b68bf3d66b984c7dab7d4fe8707d761e7cc8c896;hp=faca79768118f928fdbbd49c75d06cf0ee9fb2f9;hpb=d0e351c12fff564d876958e860338d43716dc269;p=yaz-moved-to-github.git diff --git a/src/statserv.c b/src/statserv.c index faca797..7560058 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2010 Index Data + * Copyright (C) 1995-2011 Index Data * See the file LICENSE for details. */ @@ -610,6 +610,8 @@ static void xml_config_bend_stop(void) } } +static void remove_listeners(void); + /* * handle incoming connect requests. * The dynamic mode is a bit tricky mostly because we want to avoid @@ -909,6 +911,9 @@ static void listener(IOCHAN h, int event) return; } + if (control_block.one_shot) + remove_listeners(); + yaz_log(log_sessiondetail, "Connect from %s", cs_addrstr(new_line)); no_sessions++; @@ -1129,6 +1134,13 @@ static int add_listener(char *where, int listen_id) return 0; /* OK */ } +static void remove_listeners(void) +{ + IOCHAN l = pListener; + for (; l; l = l->next) + iochan_destroy(l); +} + #ifndef WIN32 /* UNIX only (for windows we don't need to catch the signals) */ static void catchchld(int num)