From: Adam Dickmeiss Date: Fri, 24 Oct 2008 06:54:10 +0000 (+0200) Subject: For ZOOM, ensure ZOOM_EVENT_SEARCH is only fired once per search task. X-Git-Tag: v3.0.38~11 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=887e4b6664dee7210816744f92802b4d924d9a3a;p=yaz-moved-to-github.git For ZOOM, ensure ZOOM_EVENT_SEARCH is only fired once per search task. --- 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 {