- fi = GNUNET_FS_file_information_create_from_data (fs, "publish-context",
- FILESIZE, buf, kuri, meta,
- GNUNET_NO, &bo);
+
+ if (GNUNET_YES ==
+ GNUNET_CONFIGURATION_get_value_yesno (cfg,
+ "download-test",
+ "USE_INDEX"))
+ {
+ fn1 = GNUNET_DISK_mktemp ("gnunet-download-indexed-test");
+ GNUNET_assert (FILESIZE ==
+ GNUNET_DISK_fn_write (fn1, buf, FILESIZE,
+ GNUNET_DISK_PERM_USER_READ |
+ GNUNET_DISK_PERM_USER_WRITE));
+ GNUNET_free (buf);
+ fi = GNUNET_FS_file_information_create_from_file (fs, "publish-context", fn1,
+ kuri, meta, GNUNET_YES,
+ &bo);
+ indexed = GNUNET_YES;
+ }
+ else
+ {
+ fi = GNUNET_FS_file_information_create_from_data (fs, "publish-context",
+ FILESIZE, buf, kuri, meta,
+ GNUNET_NO, &bo);
+ /* note: buf will be free'd as part of 'fi' now */
+ indexed = GNUNET_NO;
+ }