X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp_command.c;h=422fef14ed2dc93f0844592b11d86b96310194ae;hb=66a4e4e13cb639eeabc09117c0378f5c69fa4b01;hp=5fc70964d95a454fbcaf50951bb564c7e64e1429;hpb=3d7f8cec2fa802808c20361c84585b36e58f40ce;p=pazpar2-moved-to-github.git diff --git a/src/http_command.c b/src/http_command.c index 5fc7096..422fef1 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -35,7 +35,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include "eventl.h" #include "parameters.h" -#include "pazpar2.h" +#include "session.h" #include "http.h" #include "settings.h" #include "client.h" @@ -116,7 +116,7 @@ struct http_session *http_session_create(struct conf_service *service, iochan_setdata(r->timeout_iochan, r); iochan_settimeout(r->timeout_iochan, service->session_timeout); - pazpar2_add_channel(r->timeout_iochan); + iochan_add(service->server->iochan_man, r->timeout_iochan); return r; } @@ -702,7 +702,7 @@ static void cmd_record(struct http_channel *c) return; } wrbuf_rewind(c->wrbuf); - if (!(rec = show_single(s->psession, idstr, &prev_r, &next_r))) + if (!(rec = show_single_start(s->psession, idstr, &prev_r, &next_r))) { if (session_active_clients(s->psession) == 0) { @@ -732,7 +732,6 @@ static void cmd_record(struct http_channel *c) if (!r) { error(rs, PAZPAR2_RECORD_FAIL, "no record at offset given"); - return; } else { @@ -780,6 +779,7 @@ static void cmd_record(struct http_channel *c) rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c); } + show_single_stop(s->psession, rec); } static void cmd_record_ready(void *data) @@ -824,7 +824,8 @@ static void show_records(struct http_channel *c, int active) return; } - rl = show(s->psession, sp, startn, &numn, &total, &total_hits, c->nmem); + + rl = show_range_start(s->psession, sp, startn, &numn, &total, &total_hits); wrbuf_rewind(c->wrbuf); wrbuf_puts(c->wrbuf, HTTP_COMMAND_RESPONSE_PREFIX "\nOK\n"); @@ -848,13 +849,16 @@ static void show_records(struct http_channel *c, int active) if (ccount > 1) wrbuf_printf(c->wrbuf, "%d\n", ccount); if (strstr(sort, "relevance")) - wrbuf_printf(c->wrbuf, "%d\n", rec->relevance); + wrbuf_printf(c->wrbuf, "%d\n", + rec->relevance_score); wrbuf_puts(c->wrbuf, ""); wrbuf_xmlputs(c->wrbuf, rec->recid); wrbuf_puts(c->wrbuf, "\n"); wrbuf_puts(c->wrbuf, "\n"); } + show_range_stop(s->psession, rl); + wrbuf_puts(c->wrbuf, "\n"); rs->payload = nmem_strdup(c->nmem, wrbuf_cstr(c->wrbuf)); http_send_response(c);