fixing quota violation messages
authorChristian Grothoff <christian@grothoff.org>
Sun, 23 Oct 2011 17:36:38 +0000 (17:36 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 23 Oct 2011 17:36:38 +0000 (17:36 +0000)
src/transport/gnunet-service-transport.c
src/transport/gnunet-service-transport_neighbours.c

index 691319c3349b214dd036c7e53792c63d9ab38a9f..4f03d2e468d2ba6f557f4c1e32ce13e123cbf4d3 100644 (file)
@@ -292,20 +292,10 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
 #if 1
   /* FIXME: this should not be needed, and not sure it's good to have it, but without
      this connections seem to go extra-slow */
-  if ((ats_count > 0) && (ats != NULL))
-  {
-    if (NULL != session)
-      GNUNET_log_from (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK,
-                      "transport-ats",
-                      "Giving ATS session %p of plugin %s for peer %s\n",
-                      session,
-                      plugin_name,
-                      GNUNET_i2s (peer));
-    GNUNET_ATS_address_update (GST_ats, peer,
-                               plugin_name, sender_address, sender_address_len,
-                               session,
-                               ats, ats_count);
-  }
+  GNUNET_ATS_address_update (GST_ats, peer,
+                            plugin_name, sender_address, sender_address_len,
+                            session,
+                            ats, ats_count);  
 #endif
 #if DEBUG_TRANSPORT
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
index 802a2cf326ae1ffad36e2447e586112a62f44a0c..e1e8b8988470262cb9e26b8796c91fac223359fb 100644 (file)
@@ -969,14 +969,14 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity
   n = lookup_neighbour (sender);
   if (n == NULL)
   {
-    GNUNET_STATISTICS_update (GST_stats,
-                              gettext_noop
-                              ("# messages discarded due to lack of neighbour record"),
-                              1, GNUNET_NO);
     GST_neighbours_try_connect (sender);
     n = lookup_neighbour (sender);
     if (NULL == n)
     {
+      GNUNET_STATISTICS_update (GST_stats,
+                               gettext_noop
+                               ("# messages discarded due to lack of neighbour record"),
+                               1, GNUNET_NO);
       *do_forward = GNUNET_NO;
       return GNUNET_TIME_UNIT_ZERO;
     }
@@ -1020,7 +1020,7 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity
     return GNUNET_CONSTANTS_QUOTA_VIOLATION_TIMEOUT;
   }
   *do_forward = GNUNET_YES;
-  ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 0);
+  ret = GNUNET_BANDWIDTH_tracker_get_delay (&n->in_tracker, 32 * 1024);
   if (ret.rel_value > 0)
   {
 #if DEBUG_TRANSPORT