-fixes
[oweals/gnunet.git] / src / fs / fs_dirmetascan.c
index 34170a8d4d0f9c6d54615ef06896dc42cbd4071a..4e5354e802c204167321f895d9f63aa1ba30bc00 100644 (file)
@@ -92,7 +92,8 @@ struct GNUNET_FS_DirScanner
 
 
 /**
- * Abort the scan.
+ * Abort the scan.  Must not be called from within the progress_callback
+ * function.
  *
  * @param ds directory scanner structure
  */
@@ -151,7 +152,7 @@ advance (struct GNUNET_FS_ShareTreeItem *pos)
   
   GNUNET_assert (NULL != pos);
   moved = 0; /* must not terminate, even on file, otherwise "normal" */
-  while ( (pos->is_directory) ||
+  while ( (pos->is_directory == GNUNET_YES) ||
          (0 == moved) )
   {
     if ( (moved != -1) &&
@@ -202,7 +203,7 @@ expand_tree (struct GNUNET_FS_ShareTreeItem *parent,
   GNUNET_asprintf (&chld->short_filename,
                   "%s%s",
                   GNUNET_STRINGS_get_short_name (filename),
-                  is_directory ? "/" : "");
+                  is_directory == GNUNET_YES ? "/" : "");
   /* make sure we do not end with '//' */
   slen = strlen (chld->short_filename);
   if ( (slen >= 2) &&
@@ -324,7 +325,7 @@ process_helper_msgs (void *cls,
                           NULL, GNUNET_SYSERR,
                           GNUNET_FS_DIRSCANNER_ALL_COUNTED);
     ds->pos = ds->toplevel;
-    if (ds->pos->is_directory)
+    if (ds->pos->is_directory == GNUNET_YES)
       ds->pos = advance (ds->pos);
     return;
   case GNUNET_MESSAGE_TYPE_FS_PUBLISH_HELPER_META_DATA:
@@ -374,6 +375,7 @@ process_helper_msgs (void *cls,
                                           ds->pos->short_filename, 
                                           strlen (ds->pos->short_filename) + 1);
       }
+      ds->pos->ksk_uri = GNUNET_FS_uri_ksk_create_from_meta_data (ds->pos->meta);
       ds->pos = advance (ds->pos);      
       return;
     }
@@ -410,7 +412,7 @@ process_helper_msgs (void *cls,
  * Start a directory scanner thread.
  *
  * @param filename name of the directory to scan
- * @param GNUNET_YES to not to run libextractor on files (only build a tree)
+ * @param disable_extractor GNUNET_YES to not to run libextractor on files (only build a tree)
  * @param ex if not NULL, must be a list of extra plugins for extractor
  * @param cb the callback to call when there are scanning progress messages
  * @param cb_cls closure for 'cb'