From: Christian Grothoff Date: Thu, 6 May 2010 09:30:39 +0000 (+0000) Subject: dsh handling X-Git-Tag: initial-import-from-subversion-38251~21864 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=031972ecd7ef2a767cbe8caf3c6fb649567a6b0d;p=oweals%2Fgnunet.git dsh handling --- diff --git a/src/fs/fs.c b/src/fs/fs.c index 778f80984..58045591e 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c @@ -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, diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 0ca7cef2d..37d33ace1 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -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);