nodeb
authorChristian Grothoff <christian@grothoff.org>
Mon, 8 Mar 2010 14:37:14 +0000 (14:37 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 8 Mar 2010 14:37:14 +0000 (14:37 +0000)
src/transport/plugin_transport_tcp.c
src/transport/transport.h
src/transport/transport_api.c

index 3b198841aa4310eef994fe169849f734092f3981..9b6200b809d043f3c038bdf24e41bd590e897902 100644 (file)
@@ -39,7 +39,7 @@
 #include "plugin_transport.h"
 #include "transport.h"
 
-#define DEBUG_TCP GNUNET_YES
+#define DEBUG_TCP GNUNET_NO
 
 /**
  * How long until we give up on transmitting the welcome message?
index d66b87b35cc4e4fd88fe8bb9783f1ad9434ed25f..acaa20a527ff41e502878878d5a1f06bad3b3b58 100644 (file)
@@ -30,9 +30,9 @@
 #include "gnunet_time_lib.h"
 #include "gnunet_transport_service.h"
 
-#define DEBUG_TRANSPORT GNUNET_YES
-#define DEBUG_TRANSPORT_TIMEOUT GNUNET_YES
-#define DEBUG_TRANSPORT_DISCONNECT GNUNET_YES
+#define DEBUG_TRANSPORT GNUNET_NO
+#define DEBUG_TRANSPORT_TIMEOUT GNUNET_NO
+#define DEBUG_TRANSPORT_DISCONNECT GNUNET_NO
 
 /**
  * For how long do we allow unused bandwidth
index 7328dc95d7219b0132fc28ea8783739fb061aec0..80eda99352dfef3b2ee5e09e1fa03ac0e87f12e4 100644 (file)
@@ -829,15 +829,31 @@ GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle,
   n = neighbour_find (handle, target);
   if (n != NULL)
     {
+#if DEBUG_TRANSPORT
       if (ntohl (quota_out.value__) != n->out_tracker.available_bytes_per_s__)
        GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                    "Quota changed from %u to %u for peer `%s'\n",
                    (unsigned int) n->out_tracker.available_bytes_per_s__,
                    (unsigned int) ntohl (quota_out.value__),
                    GNUNET_i2s (target));
+      else
+       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                   "Quota remains at %u for peer `%s'\n",
+                   (unsigned int) n->out_tracker.available_bytes_per_s__,
+                   GNUNET_i2s (target));
+#endif
       GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker,
                                             quota_out);
     }
+  else
+    {
+#if DEBUG_TRANSPORT
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                 "Quota changed to %u for peer `%s', but I have no such neighbour!\n",
+                 (unsigned int) ntohl (quota_out.value__),
+                 GNUNET_i2s (target));
+#endif
+    }
   sqc = GNUNET_malloc (sizeof (struct SetQuotaContext));
   sqc->handle = handle;
   sqc->target = *target;
@@ -1108,7 +1124,8 @@ reconnect (void *cls,
   while (NULL != n)
     {
 #if DEBUG_TRANSPORT_DISCONNECT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting due to reconnect being called\n");
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Disconnecting due to reconnect being called\n");
 #endif
       next = n->next;
       if (n->is_connected)
@@ -1116,7 +1133,8 @@ reconnect (void *cls,
       n = next;
     }
 #if DEBUG_TRANSPORT
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n");
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
+             "Connecting to transport service.\n");
 #endif
   GNUNET_assert (h->client == NULL);
   h->client = GNUNET_CLIENT_connect (h->sched, "transport", h->cfg);