changes in get and put code.
[oweals/gnunet.git] / src / peerinfo / gnunet-service-peerinfo.c
index c93072de30895f36ebdf1be9a9a75050d8c7669f..486cb24ba24aa72166ce0dceed5b959761e71fdb 100644 (file)
@@ -1071,6 +1071,7 @@ handle_get_all (void *cls, struct GNUNET_SERVER_Client *client,
   lapm = (const struct ListAllPeersMessage *) message;
   tcx.friend_only = ntohl (lapm->include_friend_only);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' message received\n", "GET_ALL");
+  GNUNET_SERVER_disable_receive_done_warning (client);
   tcx.tc = GNUNET_SERVER_transmit_context_create (client);
   GNUNET_CONTAINER_multipeermap_iterate (hostmap, &add_to_tc, &tcx);
   GNUNET_SERVER_transmit_context_append_data (tcx.tc, NULL, 0,
@@ -1255,6 +1256,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   notify_list = GNUNET_SERVER_notification_context_create (server, 0);
   noio = GNUNET_CONFIGURATION_get_value_yesno (cfg, "peerinfo", "NO_IO");
   use_included = GNUNET_CONFIGURATION_get_value_yesno (cfg, "peerinfo", "USE_INCLUDED_HELLOS");
+  if (GNUNET_SYSERR == use_included)
+    use_included = GNUNET_NO;
   GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
                                 NULL);
   if (GNUNET_YES != noio)
@@ -1277,22 +1280,22 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
                                        &cron_clean_data_hosts, NULL);
     if (GNUNET_YES == use_included)
     {
-       ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
-       GNUNET_asprintf (&peerdir,
-                    "%shellos",
-                    ip);
-       GNUNET_free (ip);
-
-                       GNUNET_log (GNUNET_ERROR_TYPE_INFO,
-                       _("Importing HELLOs from `%s'\n"),
-                       peerdir);
-                       dsc.matched = 0;
-                       dsc.remove_files = GNUNET_NO;
-
-                       GNUNET_DISK_directory_scan (peerdir,
-                                       &hosts_directory_scan_callback, &dsc);
-
-                       GNUNET_free (peerdir);
+      ip = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_DATADIR);
+      GNUNET_asprintf (&peerdir, "%shellos", ip);
+      GNUNET_free(ip);
+
+      GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Importing HELLOs from `%s'\n"),
+          peerdir);
+      dsc.matched = 0;
+      dsc.remove_files = GNUNET_NO;
+
+      GNUNET_DISK_directory_scan (peerdir, &hosts_directory_scan_callback,
+          &dsc);
+      GNUNET_free (peerdir);
+    }
+    else
+    {
+      GNUNET_log(GNUNET_ERROR_TYPE_INFO, _("Skipping import of included HELLOs\n"));
     }
   }
   GNUNET_SERVER_add_handlers (server, handlers);