X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=src%2Fhttp_command.c;h=e453a9da2327c65f1a91e3ce63ff1c2d55ab9ced;hb=b9a83dec2858e9aa4247b29b3f8f8cf42a1a786d;hp=6c99232efecd60ded0f4ce900981c180c081b377;hpb=1feb0a041e752e096256750c1ec0e8e00f1c30e5;p=pazpar2-moved-to-github.git diff --git a/src/http_command.c b/src/http_command.c index 6c99232..e453a9d 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1,5 +1,5 @@ /* - * $Id: http_command.c,v 1.1 2006-12-20 20:47:16 quinn Exp $ + * $Id: http_command.c,v 1.2 2006-12-20 22:19:35 adam Exp $ */ #include @@ -213,6 +213,7 @@ static void show_records(struct http_channel *c) struct http_response *rs = c->response; struct http_session *s = locate_session(rq, rs); struct record **rl; + NMEM nmem_show; char *start = http_argbyname(rq, "start"); char *num = http_argbyname(rq, "num"); int startn = 0; @@ -229,7 +230,8 @@ static void show_records(struct http_channel *c) if (num) numn = atoi(num); - rl = show(s->psession, startn, &numn, &total, &total_hits); + nmem_show = nmem_create(); + rl = show(s->psession, startn, &numn, &total, &total_hits, nmem_show); wrbuf_rewind(c->wrbuf); wrbuf_puts(c->wrbuf, "\nOK\n"); @@ -255,6 +257,7 @@ static void show_records(struct http_channel *c) wrbuf_puts(c->wrbuf, "\n"); rs->payload = nmem_strdup(c->nmem, wrbuf_buf(c->wrbuf)); http_send_response(c); + nmem_destroy(nmem_show); } static void show_records_ready(void *data)