- iim = (const struct IndexInfoMessage*) msg;
- filename = (const char*) &iim[1];
- if ( (ntohs (msg->type) != GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY) ||
- (msize <= sizeof (struct IndexInfoMessage)) ||
- (filename[msize-sizeof (struct IndexInfoMessage) -1] != '\0') )
- {
- /* bogus reply */
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- _("Failed to receive valid response for `%s' request from `%s' service.\n"),
- "GET_INDEXED",
- "fs");
- GNUNET_SCHEDULER_add_continuation (gic->h->sched,
- gic->cont,
- gic->cont_cls,
- GNUNET_SCHEDULER_REASON_TIMEOUT);
- GNUNET_CLIENT_disconnect (gic->client);
- GNUNET_free (gic);
- return;
- }
- if (GNUNET_OK !=
- gic->iterator (gic->iterator_cls,
- filename,
- &iim->file_id))
- {
- GNUNET_SCHEDULER_add_continuation (gic->h->sched,
- gic->cont,
- gic->cont_cls,
- GNUNET_SCHEDULER_REASON_PREREQ_DONE);
- GNUNET_CLIENT_disconnect (gic->client);
- GNUNET_free (gic);
- return;
- }
+ iim = (const struct IndexInfoMessage *) msg;
+ filename = (const char *) &iim[1];
+ if ((ntohs (msg->type) != GNUNET_MESSAGE_TYPE_FS_INDEX_LIST_ENTRY) ||
+ (msize <= sizeof (struct IndexInfoMessage)) ||
+ (filename[msize - sizeof (struct IndexInfoMessage) - 1] != '\0'))
+ {
+ /* bogus reply */
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _
+ ("Failed to receive valid response for `%s' request from `%s' service.\n"),
+ "GET_INDEXED", "fs");
+ (void) gic->iterator (gic->iterator_cls, NULL, NULL);
+ GNUNET_FS_get_indexed_files_cancel (gic);
+ return;
+ }
+ if (GNUNET_OK != gic->iterator (gic->iterator_cls, filename, &iim->file_id))
+ {
+ GNUNET_FS_get_indexed_files_cancel (gic);
+ return;
+ }