aboutsummaryrefslogtreecommitdiff
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
parent5e68fd9b64ef683e8db4351fe8681437b1c4e41e (diff)
downloadgnunet-29420025183ad85f50b82b0da5ba108df12644d7.tar.gz
gnunet-29420025183ad85f50b82b0da5ba108df12644d7.zip
unindex on failure, location URI support
-rw-r--r--TODO2
-rw-r--r--src/fs/fs_download.c1
-rw-r--r--src/fs/fs_publish.c34
-rw-r--r--src/fs/gnunet-service-fs.c3
4 files changed, 32 insertions, 8 deletions
diff --git a/TODO b/TODO
index 1188de845..bd22ce3b6 100644
--- a/TODO
+++ b/TODO
@@ -18,14 +18,12 @@
18 - implement performance tests 18 - implement performance tests
19* FS: [CG] 19* FS: [CG]
20 - trust: do not charge when "idle" / load considerations (migration, routing) 20 - trust: do not charge when "idle" / load considerations (migration, routing)
21 - unindex on index failure
22 - listing of learned namespaces 21 - listing of learned namespaces
23 - artificial delays 22 - artificial delays
24 - active reply route caching design & implementation of service; gap extension! 23 - active reply route caching design & implementation of service; gap extension!
25 - utilize in-line files in meta data always (including in search results or 24 - utilize in-line files in meta data always (including in search results or
26 when download is triggered manually and for probes); currently the data is 25 when download is triggered manually and for probes); currently the data is
27 only used when users do a general 'recursive' download 26 only used when users do a general 'recursive' download
28 - location URIs (publish, search, download)
29 - non-anonymous FS service (needs DHT) 27 - non-anonymous FS service (needs DHT)
30 + DHT integration for search 28 + DHT integration for search
31 + CS-DHT-functions (DHT-put of LOC) 29 + CS-DHT-functions (DHT-put of LOC)
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c
index 53bad3126..f1897e65f 100644
--- a/src/fs/fs_download.c
+++ b/src/fs/fs_download.c
@@ -23,7 +23,6 @@
23 * @author Christian Grothoff 23 * @author Christian Grothoff
24 * 24 *
25 * TODO: 25 * TODO:
26 * - location URI suppport (can wait, easy)
27 * - different priority for scheduling probe downloads? 26 * - different priority for scheduling probe downloads?
28 * - check if iblocks can be computed from existing blocks (can wait, hard) 27 * - check if iblocks can be computed from existing blocks (can wait, hard)
29 */ 28 */
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)
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index b3f14896b..2157ff5f5 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -2213,6 +2213,9 @@ target_peer_select_cb (void *cls,
2213 /* 3e) include peer proximity */ 2213 /* 3e) include peer proximity */
2214 score -= (2.0 * (GNUNET_CRYPTO_hash_distance_u32 (key, 2214 score -= (2.0 * (GNUNET_CRYPTO_hash_distance_u32 (key,
2215 &pr->query)) / (double) UINT32_MAX); 2215 &pr->query)) / (double) UINT32_MAX);
2216 /* 4) super-bonus for being the known target */
2217 if (pr->target_pid == cp->pid)
2218 score += 100.0;
2216 /* store best-fit in closure */ 2219 /* store best-fit in closure */
2217#if DEBUG_FS 2220#if DEBUG_FS
2218 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 2221 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,