fix
authorChristian Grothoff <christian@grothoff.org>
Fri, 2 Apr 2010 11:48:33 +0000 (11:48 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 2 Apr 2010 11:48:33 +0000 (11:48 +0000)
TODO
src/fs/fs_file_information.c
src/fs/gnunet-publish.c

diff --git a/TODO b/TODO
index e557be2868b8bc2a4d3b1c4c0446227d702664f7..7d591bd42e6104d1b4694878c9c9e6ef8418781a 100644 (file)
--- a/TODO
+++ b/TODO
@@ -26,7 +26,8 @@ away), in order in which they will likely be done:
   - utilization can (easily, restart?) go out of control (very large), causing
     content expiration job to go crazy and delete everything!
 * FS: [CG]
-  - gnunet-publish seg faults if given a directory (!)
+  - gnunet-publish uses 'NULL' for the file name when
+    publishing a directory (!)
   - on some systems, keyword search does not find locally published content
     (need testcase of command-line tools! - also good to cover getopt API!)
     [could be related to datastore issue above!]
index a110822d12517817fd586bdb22ac8f2d26b417bf..88d0ca386867877a2c97cb7918dd96373a462a32 100644 (file)
@@ -752,8 +752,7 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
 {
   struct GNUNET_FS_FileInformation *pos;
 
-  if (dir->is_directory)
-    {
+  if (GNUNET_OK !=
       proc (proc_cls, 
            dir,
            dir->data.dir.dir_size,
@@ -762,10 +761,14 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
            &dir->anonymity,
            &dir->priority,
            &dir->expirationTime,
-           &dir->client_info);
-      pos = dir->data.dir.entries;
-      while (pos != NULL)
-       {
+           &dir->client_info))
+    return;
+  if (! dir->is_directory)
+    return;
+  pos = dir->data.dir.entries;
+  while (pos != NULL)
+    {
+      if (GNUNET_OK != 
          proc (proc_cls, 
                pos,
                (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file.file_size,
@@ -774,21 +777,9 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir,
                &pos->anonymity,
                &pos->priority,
                &pos->expirationTime,
-               &pos->client_info);
-         pos = pos->next;
-       }
-    }
-  else
-    {
-      proc (proc_cls, 
-           dir,
-           dir->data.file.file_size,
-           dir->meta,
-           &dir->keywords,
-           &dir->anonymity,
-           &dir->priority,
-           &dir->expirationTime,
-           &dir->client_info);
+               &pos->client_info))
+       break;
+      pos = pos->next;
     }
 }
 
index 70964590d69bc38eb8db016c3269ee3099f73e27..b8017886edff50f457645cbb195e831d7750f688 100644 (file)
@@ -275,6 +275,8 @@ publish_inspector (void *cls,
   char *fs;
   struct GNUNET_FS_Uri *new_uri;
 
+  if (cls == fi)
+    return GNUNET_OK;
   if (NULL != topKeywords)
     {
       if (*uri != NULL)
@@ -320,7 +322,7 @@ publish_inspector (void *cls,
   if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (m))
     GNUNET_FS_file_information_inspect (fi,
                                        &publish_inspector,
-                                       NULL);
+                                       fi);
   return GNUNET_OK;
 }