Fix W32 gauger C bindings - quote arguments
[oweals/gnunet.git] / src / peerinfo / gnunet-service-peerinfo.c
index 9c3ab403215bedaa283d0d2ef2a4af1267bb2a96..18f10621a7f80aa24338bacf26dd56c3cc435005 100644 (file)
@@ -268,7 +268,7 @@ add_host_to_known_hosts (const struct GNUNET_PeerIdentity *identity)
                             GNUNET_NO);
   entry = GNUNET_malloc (sizeof (struct HostEntry));
   entry->identity = *identity;
-  GNUNET_CONTAINER_multihashmap_put (hostmap, &identity->hashPubKey, entry,
+  GNUNET_CONTAINER_multihashmap_put (hostmap, &entry->identity.hashPubKey, entry,
                                      GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY);
   fn = get_host_filename (identity);
   entry->hello = read_host_file (fn, GNUNET_YES);
@@ -449,6 +449,7 @@ bind_address (const struct GNUNET_PeerIdentity *peer,
     delta = GNUNET_HELLO_equals (mrg, host->hello, GNUNET_TIME_absolute_get ());
     if (delta.abs_value == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value)
     {
+      /* no differences, just ignore the update */
       GNUNET_free (mrg);
       return;
     }
@@ -463,7 +464,8 @@ bind_address (const struct GNUNET_PeerIdentity *peer,
                                           &cnt);
     if (0 == cnt)
     {      
-      /* no valid addresses, don't put HELLO on disk */
+      /* no valid addresses, don't put HELLO on disk; in fact,
+        if one exists on disk, remove it */
       (void) UNLINK (fn); 
     }
     else
@@ -774,7 +776,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
   char *ip;
   struct DirScanContext dsc;
 
-  hostmap = GNUNET_CONTAINER_multihashmap_create (1024);
+  hostmap = GNUNET_CONTAINER_multihashmap_create (1024, GNUNET_YES);
   stats = GNUNET_STATISTICS_create ("peerinfo", cfg);
   notify_list = GNUNET_SERVER_notification_context_create (server, 0);
   GNUNET_assert (GNUNET_OK ==