todo update
authorChristian Grothoff <christian@grothoff.org>
Sat, 1 May 2010 11:21:42 +0000 (11:21 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sat, 1 May 2010 11:21:42 +0000 (11:21 +0000)
TODO
src/fs/fs.c

diff --git a/TODO b/TODO
index 0b24b0347478ed620054f00e33955e3cc0ce301a..5d9a03b75d720bae112590bc6c9f6ed0a5ce252a 100644 (file)
--- a/TODO
+++ b/TODO
@@ -1,7 +1,9 @@
 0.9.0pre1:
 * FS: [CG]
-  - persistence support (unindex, search, download)
-  - persistence testing (publish)
+  - serialization and deserialization code (search, download)
+  - generate SUSPEND events (publish, unindex, search, download)
+  - actually call 'sync' functions (publish, unindex, search, download)
+  - persistence testing (publish, unindex)
   - gnunet-service-fs (hot-path routing, load-based routing, nitpicks)  
   - [gnunet-service-fs.c:208]: member 'LocalGetContext::results_bf_size' is never used
   - [gnunet-service-fs.c:501]: member 'PendingRequest::used_pids_size' is never used
index c0271282a4565da04f43a0796b410f7fc9188813..84985855b4cd8d1ff4f4c4259f5c231e0ca48720 100644 (file)
@@ -1403,6 +1403,46 @@ deserialize_unindex (struct GNUNET_FS_Handle *h)
 }
 
 
+
+/**
+ * Function called with a filename of serialized search operation
+ * to deserialize.
+ *
+ * @param cls the 'struct GNUNET_FS_Handle*'
+ * @param filename complete filename (absolute path)
+ * @return GNUNET_OK (continue to iterate)
+ */
+static int
+deserialize_search_file (void *cls,
+                         const char *filename)
+{
+  /* FIXME */
+  // Deserialize Search:
+  // * for each query, read file with search results
+  // * for each search result with active download, deserialize download
+  // * for each directory search result, check for active downloads of contents
+  return GNUNET_OK;
+}
+
+
+/**
+ * Deserialize information about pending search operations.
+ *
+ * @param h master context
+ */
+static void
+deserialize_search (struct GNUNET_FS_Handle *h)
+{
+  char *dn;
+
+  dn = get_serialization_file_name (h, "search", "");
+  if (dn == NULL)
+    return;
+  GNUNET_DISK_directory_scan (dn, &deserialize_search_file, h);
+  GNUNET_free (dn);
+}
+
+
 /**
  * Setup a connection to the file-sharing service.
  *
@@ -1466,18 +1506,13 @@ GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched,
     }
   va_end (ap);
   // FIXME: setup receive-loop with client (do we need one?)
-
   if (0 != (GNUNET_FS_FLAGS_PERSISTENCE & flags))
     {
+      /* FIXME: could write one generic deserialization
+        function instead of these four... */
       deserialize_publish (ret);
-      /* FIXME: not implemented! */
-      // Deserialize Search:
-      // * read search queries
-      // * for each query, read file with search results
-      // * for each search result with active download, deserialize download
-      // * for each directory search result, check for active downloads of contents
-      // Deserialize Download:
-      // * always part of search???
+      deserialize_search (ret);
+      /* FIXME: deserialize downloads that are NOT part of searches */
       deserialize_unindex (ret);
     }
   return ret;