-/* $Id: pazpar2.c,v 1.14 2007-01-04 22:04:25 quinn Exp $ */;
+/* $Id: pazpar2.c,v 1.16 2007-01-06 03:02:47 quinn Exp $ */;
#include <stdlib.h>
#include <stdio.h>
int start = cl->records + 1;
toget = global_parameters.chunk;
+ if (toget > global_parameters.toget - cl->records)
+ toget = global_parameters.toget - cl->records;
if (toget > cl->hits - cl->records)
toget = cl->hits - cl->records;
if (!(mergekey = xmlGetProp(root, "mergekey")))
{
yaz_log(YLOG_WARN, "No mergekey found in record");
+ xmlFreeDoc(xdoc);
return 0;
}
res->merge_key = normalize_mergekey(mergekey_norm);
head = reclist_insert(se->reclist, res);
+ if (!head)
+ {
+ /* no room for record */
+ xmlFreeDoc(xdoc);
+ return 0;
+ }
relevance_newrec(se->relevance, head);
for (n = root->children; n; n = n->next)