X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fsession.c;h=4d64e327292f0deb7d17a4c121309e999afcb994;hb=3179097f17e360a9c61a87686680e5e6bfac2646;hp=f7c0b99cd498512685d4028166570662709d001c;hpb=ba223db6be46354e6e3b95a9f65d62d335f11cf1;p=pazpar2-moved-to-github.git diff --git a/src/session.c b/src/session.c index f7c0b99..4d64e32 100644 --- a/src/session.c +++ b/src/session.c @@ -436,7 +436,7 @@ void session_alert_watch(struct session *s, int what) session_watchfun fun; http_remove_observer(s->watchlist[what].obs); - fun = s->watchlist[what].fun; + fun = s->watchlist[what].fun; data = s->watchlist[what].data; /* reset watch before fun is invoked - in case fun wants to set @@ -446,6 +446,7 @@ void session_alert_watch(struct session *s, int what) s->watchlist[what].obs = 0; session_leave(s); + yaz_log(YLOG_DEBUG, "session_alert_watch: %d calling function: %p", what, fun); fun(data); } else @@ -509,6 +510,19 @@ int session_active_clients(struct session *s) return res; } +int session_is_preferred_clients_ready(struct session *s) +{ + struct client_list *l; + int res = 0; + + for (l = s->clients; l; l = l->next) + if (client_is_active_preferred(l->client)) + res++; + yaz_log(YLOG_DEBUG, "%p Session has %d active preferred clients.", s, res); + return res == 0; +} + + enum pazpar2_error_code search(struct session *se, const char *query,