error msg
[oweals/gnunet.git] / src / transport / gnunet-service-transport_blacklist.c
index c71ecdfd8a0a654b8826ec592960447ff11805ce..479b30eb439a9e47e705d3291c279ebb39402cb4 100644 (file)
@@ -230,15 +230,15 @@ read_blacklist_file ()
       GNUNET_CONFIGURATION_get_value_filename (GST_cfg, "TRANSPORT",
                                                "BLACKLIST_FILE", &fn))
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                "Option `%s' in section `%s' not specified!\n",
-                "BLACKLIST_FILE", "TRANSPORT");
+    GNUNET_log_config_missing (GNUNET_ERROR_TYPE_DEBUG,
+                              "transport", "BLACKLIST_FILE");
     return;
   }
   if (GNUNET_OK != GNUNET_DISK_file_test (fn))
-    GNUNET_DISK_fn_write (fn, NULL, 0,
-                          GNUNET_DISK_PERM_USER_READ |
-                          GNUNET_DISK_PERM_USER_WRITE);
+  {
+    GNUNET_free (fn);
+    return; /* no blacklist */
+  }
   if (GNUNET_OK != GNUNET_DISK_file_size (fn,
       &fsize, GNUNET_NO, GNUNET_YES))
   {
@@ -247,9 +247,9 @@ read_blacklist_file ()
     GNUNET_free (fn);
     return;
   }
-  if (fsize == 0)
+  if (0 == fsize)
   {
-    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, _("Blacklist file `%s' is empty.\n"),
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Blacklist file `%s' is empty.\n",
                 fn);
     GNUNET_free (fn);
     return;
@@ -543,12 +543,16 @@ struct TestConnectionContext
  * @param ats performance data
  * @param ats_count number of entries in ats (excluding 0-termination)
  * @param address the address
+ * @param bandwidth_in inbound quota in NBO
+ * @param bandwidth_out outbound quota in NBO
  */
 static void
 test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour,
                     const struct GNUNET_ATS_Information *ats,
                     uint32_t ats_count,
-                    const struct GNUNET_HELLO_Address *address)
+                    const struct GNUNET_HELLO_Address *address,
+                    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
+                    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
 {
   struct TestConnectionContext *tcc = cls;
   struct GST_BlacklistCheck *bc;
@@ -684,7 +688,8 @@ GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer,
               GNUNET_i2s (peer), transport_name);
   if (blacklist == NULL)
     blacklist =
-        GNUNET_CONTAINER_multihashmap_create (TRANSPORT_BLACKLIST_HT_SIZE);
+      GNUNET_CONTAINER_multihashmap_create (TRANSPORT_BLACKLIST_HT_SIZE,
+                                           GNUNET_NO);
   GNUNET_CONTAINER_multihashmap_put (blacklist, &peer->hashPubKey,
                                      GNUNET_strdup (transport_name),
                                      GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);