fixing 1584
[oweals/gnunet.git] / src / fs / fs_unindex.c
index b6961040937f805ee742998e6901d8607dc311bc..38e1073f0a3735a263a30f67602396a11b426e1a 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -292,6 +292,11 @@ unindex_finish (void *cls,
   struct GNUNET_FS_Uri *uri;
   struct UnindexMessage req;
 
+  /* generate final progress message */
+  unindex_progress (uc, 
+                   uc->file_size,
+                   NULL,
+                   0, 0);
   GNUNET_FS_tree_encoder_finish (uc->tc,
                                 &uri,
                                 &emsg);
@@ -307,6 +312,14 @@ unindex_finish (void *cls,
   uc->client = GNUNET_CLIENT_connect (uc->h->sched,
                                      "fs",
                                      uc->h->cfg);
+  if (uc->client == NULL)
+    {
+      uc->state = UNINDEX_STATE_ERROR;
+      uc->emsg = GNUNET_strdup (_("Failed to connect to FS service for unindexing."));
+      GNUNET_FS_unindex_sync_ (uc);
+      signal_unindex_error (uc);
+      return;
+    }
   req.header.size = htons (sizeof (struct UnindexMessage));
   req.header.type = htons (GNUNET_MESSAGE_TYPE_FS_UNINDEX);
   req.reserved = 0;