- case GNUNET_FS_STATUS_SEARCH_RESULT:
- if (sks_search == event->value.search.sc)
- {
- fprintf (stderr,
- "Search result for sks received\n");
- if (! GNUNET_FS_uri_test_equal (sks_expect_uri,
- event->value.search.specifics.result.uri))
- {
- fprintf (stderr,
- "Wrong result for sks search!\n");
- err = 1;
- }
- /* give system 1ms to initiate update search! */
- GNUNET_SCHEDULER_add_delayed (sched,
- GNUNET_TIME_UNIT_MILLISECONDS,
- &abort_sks_search_task,
- NULL);
- }
- else if (ksk_search == event->value.search.sc)
- {
- fprintf (stderr,
- "Search result for ksk received\n");
- if (! GNUNET_FS_uri_test_equal (ksk_expect_uri,
- event->value.search.specifics.result.uri))
- {
- fprintf (stderr,
- "Wrong result for ksk search!\n");
- err = 1;
- }
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_ksk_search_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- }
- else
- {
- fprintf (stderr,
- "Search result received!?\n");
- GNUNET_break (0);
- }
- break;
- case GNUNET_FS_STATUS_SEARCH_ERROR:
- fprintf (stderr,
- "Error searching file: %s\n",
- event->value.search.specifics.error.message);
- if (sks_search == event->value.search.sc)
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_sks_search_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- else if (ksk_search == event->value.search.sc)
- GNUNET_SCHEDULER_add_continuation (sched,
- &abort_ksk_search_task,
- NULL,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- else
- GNUNET_break (0);
- break;
- case GNUNET_FS_STATUS_SEARCH_START:
- fprintf (stderr,
- "Search start event for `%s' received\n",
- (const char*) event->value.search.cctx);
- GNUNET_assert ( (NULL == event->value.search.cctx) ||
- (0 == strcmp ("sks_search", event->value.search.cctx)) ||
- (0 == strcmp ("ksk_search", event->value.search.cctx)));
- if (NULL == event->value.search.cctx)
- {
- GNUNET_assert (0 == strcmp ("sks_search", event->value.search.pctx));
- update_started = GNUNET_YES;
- }
- GNUNET_assert (1 == event->value.search.anonymity);
- break;
- case GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED:
- return NULL;
- case GNUNET_FS_STATUS_SEARCH_STOPPED:
- fprintf (stderr,
- "Search stop event received\n");
- GNUNET_assert ( (ksk_search == event->value.search.sc) ||
- (sks_search == event->value.search.sc));
- return NULL;
- default:
- fprintf (stderr,
- "Unexpected event: %d\n",
- event->status);
- break;