client_update_show_stat(rec->client, 1);
}
}
- if (*num > 0)
- recs =
- nmem_malloc(se->nmem, *num * sizeof(struct record_cluster *));
+ recs = nmem_malloc(se->nmem, (*num > 0 ? *num : 1) * sizeof(*recs));
for (i = 0; i < *num; i++)
{
struct record_cluster *r = reclist_read_record(se->reclist);
return -1;
}
session_enter(se, "ingest_record");
- if (client_get_session(cl) == se)
+ if (client_get_session(cl) == se && se->relevance)
ret = ingest_to_cluster(cl, xdoc, root, record_no, mergekey_norm);
session_leave(se, "ingest_record");
va_start(ap, fmt);
yaz_vsnprintf(buf, sizeof(buf)-30, fmt, ap);
- yaz_log(level, "Session %u: %s", s ? s->session_id : "-", buf);
+ yaz_log(level, "Session %u: %s", s ? s->session_id : 0, buf);
va_end(ap);
}