+static void show_records_ready(void *data)
+{
+ struct http_channel *c = (struct http_channel *) data;
+
+ show_records(c);
+}
+
+static void cmd_show(struct http_channel *c)
+{
+ struct http_request *rq = c->request;
+ struct http_response *rs = c->response;
+ struct http_session *s = locate_session(rq, rs);
+ char *block = http_argbyname(rq, "block");
+
+ if (!s)
+ return;
+
+ if (block)
+ {
+ if (!s->psession->reclist || !s->psession->reclist->num_records)
+ {
+ session_set_watch(s->psession, SESSION_WATCH_RECORDS, show_records_ready, c);
+ yaz_log(YLOG_DEBUG, "Blocking on cmd_show");
+ return;
+ }
+ }
+
+ show_records(c);
+}
+