From 031972ecd7ef2a767cbe8caf3c6fb649567a6b0d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 6 May 2010 09:30:39 +0000 Subject: [PATCH] dsh handling --- src/fs/fs.c | 8 ++++++++ src/fs/fs_publish.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) 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); -- 2.25.1