X-Git-Url: http://lists.indexdata.com/cgi-bin?a=blobdiff_plain;f=src%2Fhttp_command.c;h=5509b34136d8788e9773c39f8440263d24fc76d0;hb=330dfe997d099ee125cea44b52adec83af1face6;hp=a9057509038bc2d6dce78d00b3fc53431095691c;hpb=f55bb31d393595109096b2a675c706cea777bac5;p=pazpar2-moved-to-github.git diff --git a/src/http_command.c b/src/http_command.c index a905750..5509b34 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2010 Index Data + Copyright (C) 2006-2011 Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -109,7 +109,7 @@ struct http_session *http_session_create(struct conf_service *service, char tmp_str[50]; sprintf(tmp_str, "session#%u", sesid); - r->psession = new_session(nmem, service, tmp_str); + r->psession = new_session(nmem, service, sesid); r->session_id = sesid; r->timestamp = 0; r->nmem = nmem; @@ -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, @@ -1091,6 +1103,8 @@ static void cmd_info(struct http_channel *c) wrbuf_puts(c->wrbuf, " \n"); + info_services(c->server, c->wrbuf); + wrbuf_puts(c->wrbuf, ""); rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c);