that session is not mutex locked if client is already active */
if (was_active && !client_is_active(cl) && cl->session)
{
+
int no_active = session_active_clients(cl->session);
+ yaz_log(YLOG_DEBUG, "%s: releasing watches on zero active: %d", client_get_url(cl), no_active);
if (no_active == 0) {
session_alert_watch(cl->session, SESSION_WATCH_SHOW);
session_alert_watch(cl->session, SESSION_WATCH_SHOW_PREF);
static void client_check_preferred_watch(struct client *cl)
{
+ yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_url(cl));
struct session *se = cl->session;
if (se)
{
client_unlock(cl);
- if (session_preferred_clients_ready(se))
+ if (session_is_preferred_clients_ready(se)) {
session_alert_watch(se, SESSION_WATCH_SHOW_PREF);
+ }
+ else
+ yaz_log(YLOG_DEBUG, "client_check_preferred_watch: %s ", client_get_url(cl));
+
client_lock(cl);
}
+ else
+ yaz_log(YLOG_WARN, "client_check_preferred_watch: %s. No session!", client_get_url(cl));
+
}
void client_search_response(struct client *cl)
void client_start_search(struct client *cl);
void client_set_session(struct client *cl, struct session *se);
int client_is_active(struct client *cl);
+int client_is_active_preferred(struct client *cl);
struct client *client_next_in_session(struct client *cl);
int client_parse_query(struct client *cl, const char *query);