From a8e58692c277f450fe2550ce2458dff129a5f9a6 Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Thu, 2 Sep 2010 16:40:49 +0200 Subject: [PATCH] New block: Wait for preferred targets to be "ready" --- src/http_command.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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, -- 1.7.10.4