diff options
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r-- | src/fs/fs_publish.c | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 041d4213c..1ed37d7e4 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -84,11 +84,6 @@ publish_cleanup (struct GNUNET_FS_PublishContext *pc) | |||
84 | pc->fhc = NULL; | 84 | pc->fhc = NULL; |
85 | } | 85 | } |
86 | GNUNET_FS_file_information_destroy (pc->fi, NULL, NULL); | 86 | GNUNET_FS_file_information_destroy (pc->fi, NULL, NULL); |
87 | if (pc->ns != NULL) | ||
88 | { | ||
89 | GNUNET_FS_namespace_delete (pc->ns, GNUNET_NO); | ||
90 | pc->ns = NULL; | ||
91 | } | ||
92 | GNUNET_free_non_null (pc->nid); | 87 | GNUNET_free_non_null (pc->nid); |
93 | GNUNET_free_non_null (pc->nuid); | 88 | GNUNET_free_non_null (pc->nuid); |
94 | GNUNET_free_non_null (pc->serialization); | 89 | GNUNET_free_non_null (pc->serialization); |
@@ -271,9 +266,15 @@ static void | |||
271 | publish_sblock (struct GNUNET_FS_PublishContext *pc) | 266 | publish_sblock (struct GNUNET_FS_PublishContext *pc) |
272 | { | 267 | { |
273 | if (NULL != pc->ns) | 268 | if (NULL != pc->ns) |
274 | pc->sks_pc = GNUNET_FS_publish_sks (pc->h, pc->ns, pc->nid, pc->nuid, | 269 | pc->sks_pc = GNUNET_FS_publish_sks (pc->h, |
275 | pc->fi->meta, pc->fi->chk_uri, &pc->fi->bo, | 270 | pc->ns, |
276 | pc->options, &publish_sblocks_cont, pc); | 271 | pc->nid, |
272 | pc->nuid, | ||
273 | pc->fi->meta, | ||
274 | pc->fi->chk_uri, | ||
275 | &pc->fi->bo, | ||
276 | pc->options, | ||
277 | &publish_sblocks_cont, pc); | ||
277 | else | 278 | else |
278 | publish_sblocks_cont (pc, NULL, NULL); | 279 | publish_sblocks_cont (pc, NULL, NULL); |
279 | } | 280 | } |
@@ -1117,7 +1118,8 @@ finish_reserve (void *cls, int success, | |||
1117 | struct GNUNET_FS_PublishContext * | 1118 | struct GNUNET_FS_PublishContext * |
1118 | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, | 1119 | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, |
1119 | struct GNUNET_FS_FileInformation *fi, | 1120 | struct GNUNET_FS_FileInformation *fi, |
1120 | struct GNUNET_FS_Namespace *ns, const char *nid, | 1121 | const struct GNUNET_CRYPTO_EccPrivateKey *ns, |
1122 | const char *nid, | ||
1121 | const char *nuid, | 1123 | const char *nuid, |
1122 | enum GNUNET_FS_PublishOptions options) | 1124 | enum GNUNET_FS_PublishOptions options) |
1123 | { | 1125 | { |
@@ -1135,20 +1137,20 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, | |||
1135 | { | 1137 | { |
1136 | dsh = NULL; | 1138 | dsh = NULL; |
1137 | } | 1139 | } |
1138 | ret = GNUNET_malloc (sizeof (struct GNUNET_FS_PublishContext)); | 1140 | ret = GNUNET_new (struct GNUNET_FS_PublishContext); |
1139 | ret->dsh = dsh; | 1141 | ret->dsh = dsh; |
1140 | ret->h = h; | 1142 | ret->h = h; |
1141 | ret->fi = fi; | 1143 | ret->fi = fi; |
1142 | ret->ns = ns; | 1144 | if (NULL != ns) |
1143 | ret->options = options; | ||
1144 | if (ns != NULL) | ||
1145 | { | 1145 | { |
1146 | ns->rc++; | 1146 | ret->ns = GNUNET_new (struct GNUNET_CRYPTO_EccPrivateKey); |
1147 | *ret->ns = *ns; | ||
1147 | GNUNET_assert (NULL != nid); | 1148 | GNUNET_assert (NULL != nid); |
1148 | ret->nid = GNUNET_strdup (nid); | 1149 | ret->nid = GNUNET_strdup (nid); |
1149 | if (NULL != nuid) | 1150 | if (NULL != nuid) |
1150 | ret->nuid = GNUNET_strdup (nuid); | 1151 | ret->nuid = GNUNET_strdup (nuid); |
1151 | } | 1152 | } |
1153 | ret->options = options; | ||
1152 | /* signal start */ | 1154 | /* signal start */ |
1153 | GNUNET_FS_file_information_inspect (ret->fi, &fip_signal_start, ret); | 1155 | GNUNET_FS_file_information_inspect (ret->fi, &fip_signal_start, ret); |
1154 | ret->fi_pos = ret->fi; | 1156 | ret->fi_pos = ret->fi; |