gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r16701 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r16701 - gnunet/src/transport
Date: Mon, 5 Sep 2011 14:31:20 +0200

Author: wachs
Date: 2011-09-05 14:31:19 +0200 (Mon, 05 Sep 2011)
New Revision: 16701

Modified:
   gnunet/src/transport/gnunet-service-transport.h
   gnunet/src/transport/gnunet-service-transport_validation.c
   gnunet/src/transport/transport.h
   gnunet/src/transport/transport_api.c
Log:
separate transport api debug messages from transport debugging
re-enabling ats in validation


Modified: gnunet/src/transport/gnunet-service-transport.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport.h     2011-09-05 12:29:08 UTC 
(rev 16700)
+++ gnunet/src/transport/gnunet-service-transport.h     2011-09-05 12:31:19 UTC 
(rev 16701)
@@ -30,6 +30,8 @@
 #include "gnunet_transport_service.h"
 #include "gnunet_util_lib.h"
 
+#define VERBOSE_VALIDATION GNUNET_YES
+
 /**
  * Statistics handle.
  */

Modified: gnunet/src/transport/gnunet-service-transport_validation.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_validation.c  2011-09-05 
12:29:08 UTC (rev 16700)
+++ gnunet/src/transport/gnunet-service-transport_validation.c  2011-09-05 
12:31:19 UTC (rev 16701)
@@ -975,8 +975,7 @@
 
   /* validity achieved, remember it! */
   ve->valid_until = GNUNET_TIME_relative_to_absolute 
(HELLO_ADDRESS_EXPIRATION);
-  // FIXME: This crashes transport service
-  //  GNUNET_ATS_address_update (GST_ats, &ve->pid, ve->valid_until, 
ve->transport_name, NULL, ve->addr, ve->addrlen, NULL, 0);     /* FIXME: 
compute and add latency here... */
+  GNUNET_ATS_address_update (GST_ats, &ve->pid, ve->valid_until, 
ve->transport_name, NULL, ve->addr, ve->addrlen, NULL, 0);     /* FIXME: 
compute and add latency here... */
 
   /* build HELLO to store in PEERINFO */
   ve->copied = GNUNET_NO;
@@ -987,7 +986,7 @@
   if (GNUNET_SCHEDULER_NO_TASK != ve->timeout_task)
     GNUNET_SCHEDULER_cancel (ve->timeout_task);
 
-  /* randomly delay by up to 1h to avoid synchronous validations */
+  /* randomly delay by up to 1h to avoid   synchronous validations */
   rdelay = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 60 * 60);
   delay =
       GNUNET_TIME_relative_add (HELLO_REVALIDATION_START_TIME,

Modified: gnunet/src/transport/transport.h
===================================================================
--- gnunet/src/transport/transport.h    2011-09-05 12:29:08 UTC (rev 16700)
+++ gnunet/src/transport/transport.h    2011-09-05 12:31:19 UTC (rev 16701)
@@ -36,6 +36,8 @@
 
 #define DEBUG_TRANSPORT_DISCONNECT GNUNET_NO
 
+#define DEBUG_TRANSPORT_API GNUNET_NO
+
 /**
  * For how long do we allow unused bandwidth
  * from the past to carry over into the future? (in seconds)

Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c        2011-09-05 12:29:08 UTC (rev 
16700)
+++ gnunet/src/transport/transport_api.c        2011-09-05 12:31:19 UTC (rev 
16701)
@@ -46,7 +46,6 @@
  */
 #define STARTING_NEIGHBOURS_SIZE 16
 
-
 /**
  * Handle for a message that should be transmitted to the service.
  * Used for both control messages and normal messages.
@@ -340,7 +339,7 @@
 {
   struct Neighbour *n;
 
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Creating entry for neighbour `%4s'.\n",
               GNUNET_i2s (pid));
 #endif
@@ -412,7 +411,7 @@
   GNUNET_assert (h->client != NULL);
   if (msg == NULL)
   {
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                 "Error receiving from transport service, disconnecting 
temporarily.\n");
 #endif
@@ -431,7 +430,7 @@
       GNUNET_break (0);
       break;
     }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Receiving (my own) `%s' message, I am `%4s'.\n", "HELLO",
                 GNUNET_i2s (&me));
@@ -469,7 +468,7 @@
       GNUNET_break (0);
       break;
     }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n",
                 "CONNECT", GNUNET_i2s (&cim->id));
 #endif
@@ -491,7 +490,7 @@
     }
     dim = (const struct DisconnectInfoMessage *) msg;
     GNUNET_break (ntohl (dim->reserved) == 0);
-#if DEBUG_TRANSPORT_DISCONNECT
+#if DEBUG_TRANSPORT_API_DISCONNECT
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n",
                 "DISCONNECT", GNUNET_i2s (&dim->peer));
 #endif
@@ -510,7 +509,7 @@
       break;
     }
     okm = (const struct SendOkMessage *) msg;
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Receiving `%s' message, transmission %s.\n", "SEND_OK",
                 ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed");
@@ -532,7 +531,7 @@
     }
     break;
   case GNUNET_MESSAGE_TYPE_TRANSPORT_RECV:
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message.\n", "RECV");
 #endif
     if (size <
@@ -552,7 +551,7 @@
       GNUNET_break (0);
       break;
     }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Received message of type %u from `%4s'.\n", ntohs (imm->type),
                 GNUNET_i2s (&im->peer));
@@ -636,7 +635,7 @@
   {
     GNUNET_CONTAINER_DLL_remove (h->control_head, h->control_tail, th);
     nret = th->notify (th->notify_cls, size, &cbuf[ret]);
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Added %u bytes of control message at %u\n", nret, ret);
 #endif
@@ -697,7 +696,7 @@
   }
   /* if there are more pending messages, try to schedule those */
   schedule_transmission (h);
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Transmitting %u bytes to transport service\n", ret);
 #endif
@@ -733,7 +732,7 @@
     n->th = NULL;
     GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
     n->hn = NULL;
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Signalling timeout for transmission to peer %s due to 
congestion\n",
                 GNUNET_i2s (&n->id));
@@ -754,7 +753,7 @@
       return;                   /* no pending messages */
     size = n->th->notify_size + sizeof (struct OutboundMessage);
   }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Calling notify_transmit_ready\n");
 #endif
   h->cth =
@@ -792,9 +791,11 @@
                                             n->th->notify_size);
   else
     return;                     /* no work to be done */
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Scheduling next transmission to service in %llu ms\n",
               (unsigned long long) delay.rel_value);
+#endif
   h->quota_task =
       GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h);
 }
@@ -816,7 +817,7 @@
 {
   struct GNUNET_TRANSPORT_TransmitHandle *th;
 
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Control transmit of %u bytes requested\n", size);
 #endif
@@ -846,13 +847,13 @@
   if (buf == NULL)
   {
     /* Can only be shutdown, just give up */
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Shutdown while trying to transmit `%s' request.\n", "START");
 #endif
     return 0;
   }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", 
"START");
 #endif
   GNUNET_assert (size >= sizeof (struct StartMessage));
@@ -884,7 +885,7 @@
     /* shutdown, just give up */
     return;
   }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connecting to transport service.\n");
 #endif
   GNUNET_assert (h->client == NULL);
@@ -931,7 +932,7 @@
     th->notify (th->notify_cls, 0, NULL);
     GNUNET_free (th);
   }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Scheduling task to reconnect to transport service in %llu 
ms.\n",
               h->reconnect_delay.rel_value);
@@ -988,7 +989,7 @@
     GNUNET_free (sqc);
     return 0;
   }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Transmitting `%s' request with respect to `%4s'.\n", 
"SET_QUOTA",
               GNUNET_i2s (&sqc->target));
@@ -1031,7 +1032,7 @@
     return;
   }
   GNUNET_assert (NULL != handle->client);
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   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",
@@ -1070,7 +1071,7 @@
     GNUNET_free (pid);
     return 0;
   }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Transmitting `%s' request with respect to `%4s'.\n",
               "REQUEST_CONNECT", GNUNET_i2s (pid));
@@ -1132,7 +1133,7 @@
     GNUNET_free (msg);
     return 0;
   }
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting `%s' request.\n", 
"HELLO");
 #endif
   ssize = ntohs (msg->size);
@@ -1176,7 +1177,7 @@
   }
   msg = GNUNET_malloc (size);
   memcpy (msg, hello, size);
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Offering `%s' message of `%4s' to transport for validation.\n",
               "HELLO", GNUNET_i2s (&peer));
@@ -1279,7 +1280,7 @@
 void
 GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle)
 {
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transport disconnect called!\n");
 #endif
   /* this disconnects all neighbours... */
@@ -1366,7 +1367,7 @@
   delay = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, size);
   if (delay.rel_value > timeout.rel_value)
     delay.rel_value = 0;        /* notify immediately (with failure) */
-#if DEBUG_TRANSPORT
+#if DEBUG_TRANSPORT_API
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Bandwidth tracker allows next transmission to peer %s in %llu 
ms\n",
               GNUNET_i2s (target), (unsigned long long) delay.rel_value);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]