From: Dennis Schafroth Date: Thu, 2 Sep 2010 14:40:49 +0000 (+0200) Subject: New block: Wait for preferred targets to be "ready" X-Git-Tag: v1.5.0~27 X-Git-Url: http://lists.indexdata.com/cgi-bin?a=commitdiff_plain;h=a8e58692c277f450fe2550ce2458dff129a5f9a6;p=pazpar2-moved-to-github.git New block: Wait for preferred targets to be "ready" --- diff --git a/src/http_command.c b/src/http_command.c index a905750..198e816 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -936,7 +936,19 @@ static void cmd_show(struct http_channel *c) if (block) { - if (status && reclist_get_num_records(s->psession->reclist) == 0) + if (!strcmp(block, "preferred") && !session_preferred_clients_ready(s->psession)) { + // if there is already a watch/block. we do not block this one + if (session_set_watch(s->psession, SESSION_WATCH_SHOW_PREF, + show_records_ready, c, c) != 0) + { + yaz_log(c->http_sessions->log_level, + "%p Session %u: Blocking on cmd_show. Waiting for preferred targets", s, s->session_id); + } + release_session(c,s); + return; + + } + else if (status && reclist_get_num_records(s->psession->reclist) == 0) { // if there is already a watch/block. we do not block this one if (session_set_watch(s->psession, SESSION_WATCH_SHOW,