For ZOOM, ensure ZOOM_EVENT_SEARCH is only fired once per search task.
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 24 Oct 2008 06:54:10 +0000 (08:54 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 24 Oct 2008 06:54:10 +0000 (08:54 +0200)
src/zoom-c.c
src/zoom-p.h

index 57c083c..7e71b26 100644 (file)
@@ -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;
index 139d559..65537ac 100644 (file)
@@ -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 {