aboutsummaryrefslogtreecommitdiff
path: root/src/fs/fs_publish.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-07-10 14:30:47 +0000
committerChristian Grothoff <christian@grothoff.org>2010-07-10 14:30:47 +0000
commit29420025183ad85f50b82b0da5ba108df12644d7 (patch)
treec2b44ba469adecb809de5776fff499d430bbb925 /src/fs/fs_publish.c
parent5e68fd9b64ef683e8db4351fe8681437b1c4e41e (diff)
downloadgnunet-29420025183ad85f50b82b0da5ba108df12644d7.tar.gz
gnunet-29420025183ad85f50b82b0da5ba108df12644d7.zip
unindex on failure, location URI support
Diffstat (limited to 'src/fs/fs_publish.c')
-rw-r--r--src/fs/fs_publish.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c
index bd5a9ebd6..a19538345 100644
--- a/src/fs/fs_publish.c
+++ b/src/fs/fs_publish.c
@@ -24,11 +24,6 @@
24 * @see http://gnunet.org/encoding 24 * @see http://gnunet.org/encoding
25 * @author Krista Bennett 25 * @author Krista Bennett
26 * @author Christian Grothoff 26 * @author Christian Grothoff
27 *
28 * TODO:
29 * - indexing cleanup: unindex on failure (can wait)
30 * - datastore reservation support (optimization)
31 * - location URIs (publish with anonymity-level zero)
32 */ 27 */
33 28
34#include "platform.h" 29#include "platform.h"
@@ -172,6 +167,15 @@ ds_put_cont (void *cls,
172 pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL; 167 pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL;
173 pi.value.publish.specifics.error.message = pcc->p->emsg; 168 pi.value.publish.specifics.error.message = pcc->p->emsg;
174 pcc->p->client_info = GNUNET_FS_publish_make_status_ (&pi, pcc->sc, pcc->p, 0); 169 pcc->p->client_info = GNUNET_FS_publish_make_status_ (&pi, pcc->sc, pcc->p, 0);
170 if ( (pcc->p->is_directory == GNUNET_NO) &&
171 (pcc->p->filename != NULL) &&
172 (pcc->p->data.do_index == GNUNET_YES) )
173 {
174 /* run unindex to clean up */
175 GNUNET_FS_unindex_start (pcc->sc->h,
176 pcc->p->filename,
177 NULL);
178 }
175 } 179 }
176 if (NULL != pcc->cont) 180 if (NULL != pcc->cont)
177 pcc->sc->upload_task 181 pcc->sc->upload_task
@@ -226,6 +230,16 @@ signal_publish_error (struct GNUNET_FS_FileInformation *p,
226 pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL; 230 pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL;
227 pi.value.publish.specifics.error.message =emsg; 231 pi.value.publish.specifics.error.message =emsg;
228 p->client_info = GNUNET_FS_publish_make_status_ (&pi, sc, p, 0); 232 p->client_info = GNUNET_FS_publish_make_status_ (&pi, sc, p, 0);
233 if ( (p->is_directory == GNUNET_NO) &&
234 (p->filename != NULL) &&
235 (p->data.do_index == GNUNET_YES) )
236 {
237 /* run unindex to clean up */
238 GNUNET_FS_unindex_start (pc->h,
239 p->filename,
240 NULL);
241 }
242
229} 243}
230 244
231 245
@@ -883,6 +897,7 @@ GNUNET_FS_publish_main_ (void *cls,
883 struct GNUNET_FS_PublishContext *pc = cls; 897 struct GNUNET_FS_PublishContext *pc = cls;
884 struct GNUNET_FS_ProgressInfo pi; 898 struct GNUNET_FS_ProgressInfo pi;
885 struct GNUNET_FS_FileInformation *p; 899 struct GNUNET_FS_FileInformation *p;
900 struct GNUNET_FS_Uri *loc;
886 char *fn; 901 char *fn;
887 902
888 pc->upload_task = GNUNET_SCHEDULER_NO_TASK; 903 pc->upload_task = GNUNET_SCHEDULER_NO_TASK;
@@ -954,6 +969,15 @@ GNUNET_FS_publish_main_ (void *cls,
954 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 969 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
955 "File upload complete, now publishing KSK blocks.\n"); 970 "File upload complete, now publishing KSK blocks.\n");
956#endif 971#endif
972 if (0 == p->anonymity)
973 {
974 /* zero anonymity, box CHK URI in LOC URI */
975 loc = GNUNET_FS_uri_loc_create (p->chk_uri,
976 pc->h->cfg,
977 p->expirationTime);
978 GNUNET_FS_uri_destroy (p->chk_uri);
979 p->chk_uri = loc;
980 }
957 GNUNET_FS_publish_sync_ (pc); 981 GNUNET_FS_publish_sync_ (pc);
958 /* upload of "p" complete, publish KBlocks! */ 982 /* upload of "p" complete, publish KBlocks! */
959 if (p->keywords != NULL) 983 if (p->keywords != NULL)