dsh handling
authorChristian Grothoff <christian@grothoff.org>
Thu, 6 May 2010 09:30:39 +0000 (09:30 +0000)
committerChristian Grothoff <christian@grothoff.org>
Thu, 6 May 2010 09:30:39 +0000 (09:30 +0000)
src/fs/fs.c
src/fs/fs_publish.c

index 778f809842df669cd55d68f68b8216ff9d59a1c5..58045591ed1c62eaa7cfa5d7d2a25edf362e6e7d 100644 (file)
@@ -1419,6 +1419,14 @@ deserialize_publish_file (void *cls,
          goto cleanup;
        }
     }
+  if ( (0 == (pc->options & GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY)) &&
+       (GNUNET_YES != pc->all_done) )
+    {
+      pc->dsh = GNUNET_DATASTORE_connect (h->cfg,
+                                         h->sched);
+      if (NULL == pc->dsh)
+       goto cleanup;
+    } 
   if (fi_pos != NULL)
     {
       pc->fi_pos = find_file_position (pc->fi,
index 0ca7cef2df7b2e96222a7cbc87599c7a9ee0f957..37d33ace1d391e3e12c49e4fa7c9026fb7b4de2f 100644 (file)
@@ -120,7 +120,8 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc)
   GNUNET_free_non_null (pc->nid);  
   GNUNET_free_non_null (pc->nuid);
   GNUNET_free_non_null (pc->serialization);
-  GNUNET_DATASTORE_disconnect (pc->dsh, GNUNET_NO);
+  if (pc->dsh != NULL)
+    GNUNET_DATASTORE_disconnect (pc->dsh, GNUNET_NO);
   if (pc->client != NULL)
     GNUNET_CLIENT_disconnect (pc->client, GNUNET_NO);
   GNUNET_free (pc);