From 887e4b6664dee7210816744f92802b4d924d9a3a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 24 Oct 2008 08:54:10 +0200 Subject: [PATCH] For ZOOM, ensure ZOOM_EVENT_SEARCH is only fired once per search task. --- src/zoom-c.c | 10 +++++++--- src/zoom-p.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/zoom-c.c b/src/zoom-c.c index 57c083c..7e71b26 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -930,6 +930,7 @@ ZOOM_API(ZOOM_resultset) task->u.search.resultset = r; task->u.search.start = start; task->u.search.count = count; + task->u.search.recv_search_fired = 0; syntax = ZOOM_options_get(r->options, "preferredRecordSyntax"); task->u.search.syntax = syntax ? xstrdup(syntax) : 0; @@ -3995,9 +3996,12 @@ static zoom_ret handle_srw_response(ZOOM_connection c, syntax = c->tasks->u.search.syntax; elementSetName = c->tasks->u.search.elementSetName; - event = ZOOM_Event_create(ZOOM_EVENT_RECV_SEARCH); - ZOOM_connection_put_event(c, event); - + if (!c->tasks->u.search.recv_search_fired) + { + event = ZOOM_Event_create(ZOOM_EVENT_RECV_SEARCH); + ZOOM_connection_put_event(c, event); + c->tasks->u.search.recv_search_fired = 1; + } break; case ZOOM_TASK_RETRIEVE: resultset = c->tasks->u.retrieve.resultset; diff --git a/src/zoom-p.h b/src/zoom-p.h index 139d559..65537ac 100644 --- a/src/zoom-p.h +++ b/src/zoom-p.h @@ -200,6 +200,7 @@ struct ZOOM_task_p { ZOOM_resultset resultset; char *syntax; char *elementSetName; + int recv_search_fired; } search; #define ZOOM_TASK_RETRIEVE 2 struct { -- 1.7.10.4