Merge branch 'master' into session_lock
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 25 Feb 2013 13:07:02 +0000 (14:07 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 25 Feb 2013 13:07:02 +0000 (14:07 +0100)
1  2 
src/client.c
src/http_command.c
src/session.c
src/session.h

diff --cc src/client.c
Simple merge
@@@ -1117,9 -1117,13 +1119,12 @@@ static void show_records(struct http_ch
      {
          error(rs, PAZPAR2_MALFORMED_PARAMETER_VALUE, "sort");
          return;
 -
      }
  
-     rl = show_range_start(s->psession, sp, startn, &numn, &total, &total_hits, &approx_hits);
+     rl = show_range_start(s->psession, sp, startn, &numn, &total,
+                           &total_hits, &approx_hits, show_records_ready, c);
+     if (!rl)
+         return;
  
      response_open(c, "show");
      wrbuf_printf(c->wrbuf, "\n<activeclients>%d</activeclients>\n", active);
diff --cc src/session.c
@@@ -1325,6 -1343,25 +1376,24 @@@ struct record_cluster **show_range_star
              yaz_timing_get_sys(t));
      yaz_timing_destroy(&t);
  #endif
+     if (!session_fetch_more(se))
+         session_log(se, YLOG_LOG, "can not fetch more");
+     else
+     {
 -        show_range_stop(se, recs);
+         session_log(se, YLOG_LOG, "fetching more in progress");
+         if (session_set_watch(se, SESSION_WATCH_SHOW,
+                               show_records_ready, chan, chan))
+         {
+             session_log(se, YLOG_WARN, "Ignoring show block");
 -            session_enter(se, "show_range_start");
+         }
+         else
+         {
++            show_range_stop(se, recs);
+             session_log(se, YLOG_LOG, "session watch OK");
+             return 0;
+         }
+     }
      return recs;
  }
  
diff --cc src/session.h
Simple merge