fix simulation option
authorChristian Grothoff <christian@grothoff.org>
Mon, 24 Jan 2011 12:31:24 +0000 (12:31 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 24 Jan 2011 12:31:24 +0000 (12:31 +0000)
src/fs/fs_publish.c

index 6c933a37d3d4566ee919ca8b2f07a9f9a6d5a5a1..ac69c94a1039caff60227908d37fb9ca13287664 100644 (file)
@@ -838,6 +838,16 @@ hash_for_index_cb (void *cls,
              p->filename,
              GNUNET_h2s (res));
 #endif
+  if (0 != (sc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY))
+    {
+      p->data.file.file_id = *res;
+      p->data.file.have_hash = GNUNET_YES;
+      p->data.file.index_start_confirmed = GNUNET_YES;
+      GNUNET_FS_file_information_sync_ (p);
+      publish_content (sc);
+      GNUNET_free (fn);
+      return;
+    }
   client = GNUNET_CLIENT_connect ("fs",
                                  sc->h->cfg);
   if (NULL == client)
@@ -1261,6 +1271,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h,
   ret->h = h;
   ret->fi = fi;
   ret->namespace = namespace;
+  ret->options = options;
   if (namespace != NULL)
     {
       namespace->rc++;