From 7c4f2139acd38e5ce81cbcda225a499566d44df2 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 4 Jun 2014 15:08:10 +0200 Subject: [PATCH] Fix dup ZOOM_EVENT_RECV_RECORD events for SRU/Solr YAZ-768 --- src/zoom-sru.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/zoom-sru.c b/src/zoom-sru.c index 0185e68..7657773 100644 --- a/src/zoom-sru.c +++ b/src/zoom-sru.c @@ -254,6 +254,7 @@ static zoom_ret handle_srw_response(ZOOM_connection c, Z_SRW_searchRetrieveResponse *res) { ZOOM_resultset resultset = 0; + int *start, *count; int i; NMEM nmem; ZOOM_Event event; @@ -266,6 +267,8 @@ static zoom_ret handle_srw_response(ZOOM_connection c, return zoom_complete; resultset = c->tasks->u.search.resultset; + start = &c->tasks->u.search.start; + count = &c->tasks->u.search.count; syntax = c->tasks->u.search.syntax; elementSetName = c->tasks->u.search.elementSetName; schema = c->tasks->u.search.schema; @@ -374,6 +377,10 @@ static zoom_ret handle_srw_response(ZOOM_connection c, schema, diag); } } + *count -= i; + if (*count < 0) + *count = 0; + *start += i; nmem = odr_extract_mem(c->odr_in); nmem_transfer(odr_getmem(resultset->odr), nmem); nmem_destroy(nmem); -- 1.7.10.4