-fix shutdown issues on error
authorChristian Grothoff <christian@grothoff.org>
Sun, 29 Jan 2012 21:26:46 +0000 (21:26 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 29 Jan 2012 21:26:46 +0000 (21:26 +0000)
src/fs/fs_dirmetascan.c
src/fs/gnunet-publish.c

index 69c7770db753601295f8141331b818d576612324..35e95c00bec4bb48ff5e9226ec9a834c58cdb13e 100644 (file)
@@ -100,7 +100,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds)
   /* free resources */
   if (NULL != ds->toplevel)
     GNUNET_FS_share_tree_free (ds->toplevel);
-  GNUNET_free (ds->ex_arg);
+  GNUNET_free_non_null (ds->ex_arg);
   GNUNET_free (ds->filename_expanded);
   GNUNET_free (ds);
 }
@@ -300,6 +300,10 @@ process_helper_msgs (void *cls,
       if (0 != strcmp (filename,
                       ds->pos->filename))
       {
+       fprintf (stderr,
+                "Expected `%s', got `%s'\n",
+                ds->pos->filename,
+                filename);
        GNUNET_break (0);
        break;
       }
index 9cc55a29075ceeb89e3536aef00d7e9b35ef4a18..a0fd968295a8892800cd3c31b6e296c8743bc485 100644 (file)
@@ -345,6 +345,9 @@ uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri,
 }
 
 
+/**
+ * FIXME: docu
+ */
 static struct GNUNET_FS_FileInformation *
 get_file_information (struct GNUNET_FS_ShareTreeItem *item)
 {
@@ -385,6 +388,9 @@ get_file_information (struct GNUNET_FS_ShareTreeItem *item)
 }
 
 
+/**
+ * FIXME: docu
+ */
 static void
 directory_trim_complete ()
 {
@@ -481,6 +487,11 @@ directory_scan_cb (void *cls,
     if (namespace != NULL)
       GNUNET_FS_namespace_delete (namespace, GNUNET_NO);
     GNUNET_FS_stop (ctx);
+    if (kill_task != GNUNET_SCHEDULER_NO_TASK)
+    {
+      GNUNET_SCHEDULER_cancel (kill_task);
+      kill_task = GNUNET_SCHEDULER_NO_TASK;
+    }
     ret = 1;
     break;
   default: