X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp_command.c;h=37c96fafc1980c7eb6e13409977c486de137f640;hb=ad96f98478e2e653c503ae3cbfc3a3b80f0c5a1b;hp=a9057509038bc2d6dce78d00b3fc53431095691c;hpb=f55bb31d393595109096b2a675c706cea777bac5;p=pazpar2-moved-to-github.git diff --git a/src/http_command.c b/src/http_command.c index a905750..37c96fa 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_is_preferred_clients_ready(s->psession) && 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_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,