gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r12198 - in gnunet: . src/fs


From: gnunet
Subject: [GNUnet-SVN] r12198 - in gnunet: . src/fs
Date: Sat, 10 Jul 2010 16:30:47 +0200

Author: grothoff
Date: 2010-07-10 16:30:47 +0200 (Sat, 10 Jul 2010)
New Revision: 12198

Modified:
   gnunet/TODO
   gnunet/src/fs/fs_download.c
   gnunet/src/fs/fs_publish.c
   gnunet/src/fs/gnunet-service-fs.c
Log:
unindex on failure, location URI support

Modified: gnunet/TODO
===================================================================
--- gnunet/TODO 2010-07-09 15:34:27 UTC (rev 12197)
+++ gnunet/TODO 2010-07-10 14:30:47 UTC (rev 12198)
@@ -18,14 +18,12 @@
   - implement performance tests
 * FS: [CG]
   - trust: do not charge when "idle" / load considerations (migration, routing)
-  - unindex on index failure
   - listing of learned namespaces
   - artificial delays
   - active reply route caching design & implementation of service; gap 
extension!
   - utilize in-line files in meta data always (including in search results or
     when download is triggered manually and for probes); currently the data is
     only used when users do a general 'recursive' download
-  - location URIs (publish, search, download)
   - non-anonymous FS service (needs DHT)
     + DHT integration for search
     + CS-DHT-functions (DHT-put of LOC)

Modified: gnunet/src/fs/fs_download.c
===================================================================
--- gnunet/src/fs/fs_download.c 2010-07-09 15:34:27 UTC (rev 12197)
+++ gnunet/src/fs/fs_download.c 2010-07-10 14:30:47 UTC (rev 12198)
@@ -23,7 +23,6 @@
  * @author Christian Grothoff
  *
  * TODO:
- * - location URI suppport (can wait, easy)
  * - different priority for scheduling probe downloads?
  * - check if iblocks can be computed from existing blocks (can wait, hard)
  */

Modified: gnunet/src/fs/fs_publish.c
===================================================================
--- gnunet/src/fs/fs_publish.c  2010-07-09 15:34:27 UTC (rev 12197)
+++ gnunet/src/fs/fs_publish.c  2010-07-10 14:30:47 UTC (rev 12198)
@@ -24,11 +24,6 @@
  * @see http://gnunet.org/encoding
  * @author Krista Bennett
  * @author Christian Grothoff
- *
- * TODO:
- * - indexing cleanup: unindex on failure (can wait)
- * - datastore reservation support (optimization)
- * - location URIs (publish with anonymity-level zero)
  */
 
 #include "platform.h"
@@ -172,6 +167,15 @@
       pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL;
       pi.value.publish.specifics.error.message = pcc->p->emsg;
       pcc->p->client_info = GNUNET_FS_publish_make_status_ (&pi, pcc->sc, 
pcc->p, 0);
+      if ( (pcc->p->is_directory == GNUNET_NO) &&
+          (pcc->p->filename != NULL) &&
+          (pcc->p->data.do_index == GNUNET_YES) )
+       {
+         /* run unindex to clean up */
+         GNUNET_FS_unindex_start (pcc->sc->h,
+                                  pcc->p->filename,
+                                  NULL);
+       }          
     }
   if (NULL != pcc->cont)
     pcc->sc->upload_task 
@@ -226,6 +230,16 @@
   pi.value.publish.eta = GNUNET_TIME_UNIT_FOREVER_REL;
   pi.value.publish.specifics.error.message =emsg;
   p->client_info = GNUNET_FS_publish_make_status_ (&pi, sc, p, 0);
+  if ( (p->is_directory == GNUNET_NO) &&
+       (p->filename != NULL) &&
+       (p->data.do_index == GNUNET_YES) )
+    {
+      /* run unindex to clean up */
+      GNUNET_FS_unindex_start (pc->h,
+                              p->filename,
+                              NULL);
+    }     
+  
 }
 
 
@@ -883,6 +897,7 @@
   struct GNUNET_FS_PublishContext *pc = cls;
   struct GNUNET_FS_ProgressInfo pi;
   struct GNUNET_FS_FileInformation *p;
+  struct GNUNET_FS_Uri *loc;
   char *fn;
 
   pc->upload_task = GNUNET_SCHEDULER_NO_TASK;  
@@ -954,6 +969,15 @@
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "File upload complete, now publishing KSK blocks.\n");
 #endif
+      if (0 == p->anonymity)
+       {
+         /* zero anonymity, box CHK URI in LOC URI */
+         loc = GNUNET_FS_uri_loc_create (p->chk_uri,
+                                         pc->h->cfg,
+                                         p->expirationTime);
+         GNUNET_FS_uri_destroy (p->chk_uri);
+         p->chk_uri = loc;
+       }
       GNUNET_FS_publish_sync_ (pc);
       /* upload of "p" complete, publish KBlocks! */
       if (p->keywords != NULL)

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2010-07-09 15:34:27 UTC (rev 12197)
+++ gnunet/src/fs/gnunet-service-fs.c   2010-07-10 14:30:47 UTC (rev 12198)
@@ -2213,6 +2213,9 @@
   /* 3e) include peer proximity */
   score -= (2.0 * (GNUNET_CRYPTO_hash_distance_u32 (key,
                                                    &pr->query)) / (double) 
UINT32_MAX);
+  /* 4) super-bonus for being the known target */
+  if (pr->target_pid == cp->pid)
+    score += 100.0;
   /* store best-fit in closure */
 #if DEBUG_FS
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]