-fix NPE
[oweals/gnunet.git] / src / transport / transport_api.c
index 312762ba40e4801d1f79dfad3a4be5981a567012..50296855385e5862ecdd730b08ec8e3c0378b7ca 100644 (file)
 
 #define LOG(kind,...) GNUNET_log_from (kind, "transport-api",__VA_ARGS__)
 
+/**
+ * If we could not send any payload to a peer for this amount of
+ * time, we print a warning.
+ */
+#define UNREADY_WARN_TIME GNUNET_TIME_UNIT_MINUTES
+
 /**
  * How large to start with for the hashmap of neighbours.
  */
@@ -75,6 +81,11 @@ struct GNUNET_TRANSPORT_TransmitHandle
    */
   void *notify_cls;
 
+  /**
+   * Time at which this request was originally scheduled.
+   */
+  struct GNUNET_TIME_Absolute request_start;
+
   /**
    * Timeout for this request, 0 for control messages.
    */
@@ -129,6 +140,16 @@ struct Neighbour
    */
   struct GNUNET_CONTAINER_HeapNode *hn;
 
+  /**
+   * Last time when this peer received payload from us.
+   */
+  struct GNUNET_TIME_Absolute last_payload;
+
+  /**
+   * Task to trigger warnings if we do not get SEND_OK after a while.
+   */
+  struct GNUNET_SCHEDULER_Task *unready_warn_task;
+
   /**
    * Is this peer currently ready to receive a message?
    */
@@ -434,7 +455,7 @@ struct GNUNET_TRANSPORT_Handle
   /**
    * ID of the task trying to reconnect to the service.
    */
-  struct GNUNET_SCHEDULER_Task * reconnect_task;
+  struct GNUNET_SCHEDULER_Task *reconnect_task;
 
   /**
    * ID of the task trying to trigger transmission for a peer while
@@ -482,6 +503,32 @@ static void
 disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h);
 
 
+/**
+ * A neighbour has not gotten a SEND_OK in a  while. Print a warning.
+ *
+ * @param cls the `struct Neighbour`
+ * @param tc scheduler context
+ */
+static void
+do_warn_unready (void *cls,
+                 const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  struct Neighbour *n = cls;
+  struct GNUNET_TIME_Relative delay;
+
+  delay = GNUNET_TIME_absolute_get_duration (n->last_payload);
+  GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+              "Lacking SEND_OK, no payload could be send to %s for %s\n",
+              GNUNET_i2s (&n->id),
+              GNUNET_STRINGS_relative_time_to_string (delay,
+                                                      GNUNET_YES));
+  n->unready_warn_task
+    = GNUNET_SCHEDULER_add_delayed (UNREADY_WARN_TIME,
+                                    &do_warn_unready,
+                                    n);
+}
+
+
 /**
  * Get the neighbour list entry for the given peer
  *
@@ -595,10 +642,18 @@ neighbour_delete (void *cls,
   struct GNUNET_TRANSPORT_Handle *handle = cls;
   struct Neighbour *n = value;
 
+  LOG (GNUNET_ERROR_TYPE_DEBUG,
+       "Dropping entry for neighbour `%s'.\n",
+       GNUNET_i2s (key));
   GNUNET_BANDWIDTH_tracker_notification_stop (&n->out_tracker);
   if (NULL != handle->nd_cb)
     handle->nd_cb (handle->cls,
                    &n->id);
+  if (NULL != n->unready_warn_task)
+  {
+    GNUNET_SCHEDULER_cancel (n->unready_warn_task);
+    n->unready_warn_task = NULL;
+  }
   GNUNET_assert (NULL == n->th);
   GNUNET_assert (NULL == n->hn);
   GNUNET_assert (GNUNET_YES ==
@@ -688,6 +743,8 @@ demultiplexer (void *cls,
     if (size < sizeof (struct ConnectInfoMessage))
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     cim = (const struct ConnectInfoMessage *) msg;
@@ -695,6 +752,8 @@ demultiplexer (void *cls,
         sizeof (struct ConnectInfoMessage))
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -704,6 +763,8 @@ demultiplexer (void *cls,
     if (NULL != n)
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     n = neighbour_add (h,
@@ -722,6 +783,8 @@ demultiplexer (void *cls,
     if (size != sizeof (struct DisconnectInfoMessage))
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     dim = (const struct DisconnectInfoMessage *) msg;
@@ -733,6 +796,8 @@ demultiplexer (void *cls,
     if (NULL == n)
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     neighbour_delete (h,
@@ -743,6 +808,8 @@ demultiplexer (void *cls,
     if (size != sizeof (struct SendOkMessage))
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     okm = (const struct SendOkMessage *) msg;
@@ -752,10 +819,17 @@ demultiplexer (void *cls,
          "Receiving SEND_OK message, transmission %s.\n",
          ntohl (okm->success) == GNUNET_OK ? "succeeded" : "failed");
 
-    n = neighbour_find (h, &okm->peer);
+    n = neighbour_find (h,
+                        &okm->peer);
     if (NULL == n)
+    {
+      /* We should never get a 'SEND_OK' for a peer that we are not
+         connected to */
+      GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
-
+    }
     if (bytes_physical >= bytes_msg)
     {
       LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -766,6 +840,11 @@ demultiplexer (void *cls,
     }
     GNUNET_break (GNUNET_NO == n->is_ready);
     n->is_ready = GNUNET_YES;
+    if (NULL != n->unready_warn_task)
+    {
+      GNUNET_SCHEDULER_cancel (n->unready_warn_task);
+      n->unready_warn_task = NULL;
+    }
     if ((NULL != n->th) && (NULL == n->hn))
     {
       GNUNET_assert (NULL != n->th->timeout_task);
@@ -782,6 +861,8 @@ demultiplexer (void *cls,
         sizeof (struct InboundMessage) + sizeof (struct GNUNET_MessageHeader))
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     im = (const struct InboundMessage *) msg;
@@ -789,6 +870,8 @@ demultiplexer (void *cls,
     if (ntohs (imm->size) + sizeof (struct InboundMessage) != size)
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     LOG (GNUNET_ERROR_TYPE_DEBUG,
@@ -798,6 +881,8 @@ demultiplexer (void *cls,
     if (NULL == n)
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     if (NULL != h->rec)
@@ -809,12 +894,19 @@ demultiplexer (void *cls,
     if (size != sizeof (struct QuotaSetMessage))
     {
       GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
     }
     qm = (const struct QuotaSetMessage *) msg;
     n = neighbour_find (h, &qm->peer);
     if (NULL == n)
+    {
+      GNUNET_break (0);
+      h->reconnecting = GNUNET_YES;
+      disconnect_and_schedule_reconnect (h);
       break;
+    }
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Receiving SET_QUOTA message for `%s' with quota %u\n",
          GNUNET_i2s (&qm->peer),
@@ -847,8 +939,15 @@ timeout_request_due_to_congestion (void *cls,
 {
   struct GNUNET_TRANSPORT_TransmitHandle *th = cls;
   struct Neighbour *n = th->neighbour;
+  struct GNUNET_TIME_Relative delay;
 
   n->th->timeout_task = NULL;
+  delay = GNUNET_TIME_absolute_get_duration (th->request_start);
+  LOG (GNUNET_ERROR_TYPE_WARNING,
+       "Discarding %u bytes of payload message after %s delay due to congestion\n",
+       th->notify_size,
+       GNUNET_STRINGS_relative_time_to_string (delay,
+                                               GNUNET_YES));
   GNUNET_assert (th == n->th);
   GNUNET_assert (NULL == n->hn);
   n->th = NULL;
@@ -874,6 +973,7 @@ transport_notify_ready (void *cls,
 {
   struct GNUNET_TRANSPORT_Handle *h = cls;
   struct GNUNET_TRANSPORT_TransmitHandle *th;
+  struct GNUNET_TIME_Relative delay;
   struct Neighbour *n;
   char *cbuf;
   struct OutboundMessage obm;
@@ -899,19 +999,32 @@ transport_notify_ready (void *cls,
     GNUNET_CONTAINER_DLL_remove (h->control_head,
                                  h->control_tail,
                                  th);
-    nret = th->notify (th->notify_cls, size, &cbuf[ret]);
-    LOG (GNUNET_ERROR_TYPE_DEBUG,
-         "Added %u bytes of control message at %u\n",
-         nret,
-         ret);
+    nret = th->notify (th->notify_cls,
+                       size,
+                       &cbuf[ret]);
+    delay = GNUNET_TIME_absolute_get_duration (th->request_start);
+    if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+           "Added %u bytes of control message at %u after %s delay\n",
+           nret,
+           ret,
+           GNUNET_STRINGS_relative_time_to_string (delay,
+                                                   GNUNET_YES));
+    else
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "Added %u bytes of control message at %u after %s delay\n",
+           nret,
+           ret,
+           GNUNET_STRINGS_relative_time_to_string (delay,
+                                                   GNUNET_YES));
     GNUNET_free (th);
     ret += nret;
     size -= nret;
   }
 
   /* then, if possible and no control messages pending, send data messages */
-  while ((NULL == h->control_head) &&
-         (NULL != (n = GNUNET_CONTAINER_heap_peek (h->ready_heap))))
+  while ( (NULL == h->control_head) &&
+          (NULL != (n = GNUNET_CONTAINER_heap_peek (h->ready_heap))) )
   {
     if (GNUNET_YES != n->is_ready)
     {
@@ -919,8 +1032,8 @@ transport_notify_ready (void *cls,
       GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
       n->hn = NULL;
       GNUNET_assert (NULL == n->th->timeout_task);
-      n->th->timeout_task =
-          GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
+      n->th->timeout_task
+        = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
                                         (n->th->timeout),
                                         &timeout_request_due_to_congestion,
                                         n->th);
@@ -935,29 +1048,58 @@ transport_notify_ready (void *cls,
     GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap));
     n->hn = NULL;
     n->th = NULL;
-    n->is_ready = GNUNET_NO;
     GNUNET_assert (size >= sizeof (struct OutboundMessage));
-    mret =
-        th->notify (th->notify_cls, size - sizeof (struct OutboundMessage),
-                    &cbuf[ret + sizeof (struct OutboundMessage)]);
+    mret = th->notify (th->notify_cls,
+                       size - sizeof (struct OutboundMessage),
+                       &cbuf[ret + sizeof (struct OutboundMessage)]);
     GNUNET_assert (mret <= size - sizeof (struct OutboundMessage));
-    if (mret != 0)
+    if (0 == mret)
     {
-      GNUNET_assert (mret + sizeof (struct OutboundMessage) <
-                     GNUNET_SERVER_MAX_MESSAGE_SIZE);
-      obm.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SEND);
-      obm.header.size = htons (mret + sizeof (struct OutboundMessage));
-      obm.reserved = htonl (0);
-      obm.timeout =
-          GNUNET_TIME_relative_hton (GNUNET_TIME_absolute_get_remaining
-                                     (th->timeout));
-      obm.peer = n->id;
-      memcpy (&cbuf[ret], &obm, sizeof (struct OutboundMessage));
-      ret += (mret + sizeof (struct OutboundMessage));
-      size -= (mret + sizeof (struct OutboundMessage));
-      GNUNET_BANDWIDTH_tracker_consume (&n->out_tracker, mret);
+      GNUNET_free (th);
+      continue;
     }
+    if (NULL != n->unready_warn_task)
+      n->unready_warn_task
+        = GNUNET_SCHEDULER_add_delayed (UNREADY_WARN_TIME,
+                                        &do_warn_unready,
+                                        n);
+    n->last_payload = GNUNET_TIME_absolute_get ();
+    n->is_ready = GNUNET_NO;
+    GNUNET_assert (mret + sizeof (struct OutboundMessage) <
+                   GNUNET_SERVER_MAX_MESSAGE_SIZE);
+    obm.header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_SEND);
+    obm.header.size = htons (mret + sizeof (struct OutboundMessage));
+    obm.reserved = htonl (0);
+    obm.timeout =
+      GNUNET_TIME_relative_hton (GNUNET_TIME_absolute_get_remaining
+                                 (th->timeout));
+    obm.peer = n->id;
+    memcpy (&cbuf[ret],
+            &obm,
+            sizeof (struct OutboundMessage));
+    ret += (mret + sizeof (struct OutboundMessage));
+    size -= (mret + sizeof (struct OutboundMessage));
+    GNUNET_BANDWIDTH_tracker_consume (&n->out_tracker,
+                                      mret);
+    delay = GNUNET_TIME_absolute_get_duration (th->request_start);
+    if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
+      LOG (GNUNET_ERROR_TYPE_WARNING,
+           "Added %u bytes of payload message for %s after %s delay at %u b/s\n",
+           mret,
+           GNUNET_i2s (&n->id),
+           GNUNET_STRINGS_relative_time_to_string (delay,
+                                                   GNUNET_YES),
+           (unsigned int) n->out_tracker.available_bytes_per_s__);
+    else
+      LOG (GNUNET_ERROR_TYPE_DEBUG,
+           "Added %u bytes of payload message for %s after %s delay at %u b/s\n",
+           mret,
+           GNUNET_i2s (&n->id),
+           GNUNET_STRINGS_relative_time_to_string (delay,
+                                                   GNUNET_YES),
+           (unsigned int) n->out_tracker.available_bytes_per_s__);
     GNUNET_free (th);
+    break;
   }
   /* if there are more pending messages, try to schedule those */
   schedule_transmission (h);
@@ -987,8 +1129,8 @@ schedule_transmission_task (void *cls,
   h->quota_task = NULL;
   GNUNET_assert (NULL != h->client);
   /* destroy all requests that have timed out */
-  while ((NULL != (n = GNUNET_CONTAINER_heap_peek (h->ready_heap))) &&
-         (0 == GNUNET_TIME_absolute_get_remaining (n->th->timeout).rel_value_us))
+  while ( (NULL != (n = GNUNET_CONTAINER_heap_peek (h->ready_heap))) &&
+          (0 == GNUNET_TIME_absolute_get_remaining (n->th->timeout).rel_value_us) )
   {
     /* notify client that the request could not be satisfied within
      * the given time constraints */
@@ -999,7 +1141,9 @@ schedule_transmission_task (void *cls,
     LOG (GNUNET_ERROR_TYPE_DEBUG,
          "Signalling timeout for transmission to peer %s due to congestion\n",
          GNUNET_i2s (&n->id));
-    GNUNET_assert (0 == th->notify (th->notify_cls, 0, NULL));
+    GNUNET_assert (0 == th->notify (th->notify_cls,
+                                    0,
+                                    NULL));
     GNUNET_free (th);
   }
   if (NULL != h->cth)
@@ -1017,10 +1161,12 @@ schedule_transmission_task (void *cls,
   }
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Calling notify_transmit_ready\n");
-  h->cth =
-      GNUNET_CLIENT_notify_transmit_ready (h->client, size,
+  h->cth
+    = GNUNET_CLIENT_notify_transmit_ready (h->client,
+                                           size,
                                            GNUNET_TIME_UNIT_FOREVER_REL,
-                                           GNUNET_NO, &transport_notify_ready,
+                                           GNUNET_NO,
+                                           &transport_notify_ready,
                                            h);
   GNUNET_assert (NULL != h->cth);
 }
@@ -1039,7 +1185,7 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h)
   struct Neighbour *n;
 
   GNUNET_assert (NULL != h->client);
-  if (h->quota_task != NULL)
+  if (NULL != h->quota_task)
   {
     GNUNET_SCHEDULER_cancel (h->quota_task);
     h->quota_task = NULL;
@@ -1057,9 +1203,12 @@ schedule_transmission (struct GNUNET_TRANSPORT_Handle *h)
     return;                     /* no work to be done */
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Scheduling next transmission to service in %s\n",
-       GNUNET_STRINGS_relative_time_to_string (delay, GNUNET_YES));
+       GNUNET_STRINGS_relative_time_to_string (delay,
+                                               GNUNET_YES));
   h->quota_task =
-      GNUNET_SCHEDULER_add_delayed (delay, &schedule_transmission_task, h);
+      GNUNET_SCHEDULER_add_delayed (delay,
+                                    &schedule_transmission_task,
+                                    h);
 }
 
 
@@ -1088,7 +1237,10 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h,
   th->notify = notify;
   th->notify_cls = notify_cls;
   th->notify_size = size;
-  GNUNET_CONTAINER_DLL_insert_tail (h->control_head, h->control_tail, th);
+  th->request_start = GNUNET_TIME_absolute_get ();
+  GNUNET_CONTAINER_DLL_insert_tail (h->control_head,
+                                    h->control_tail,
+                                    th);
   schedule_transmission (h);
   return th;
 }
@@ -1103,7 +1255,9 @@ schedule_control_transmit (struct GNUNET_TRANSPORT_Handle *h,
  * @return number of bytes copied to @a buf
  */
 static size_t
-send_start (void *cls, size_t size, void *buf)
+send_start (void *cls,
+            size_t size,
+            void *buf)
 {
   struct GNUNET_TRANSPORT_Handle *h = cls;
   struct StartMessage s;
@@ -1124,7 +1278,7 @@ send_start (void *cls, size_t size, void *buf)
   options = 0;
   if (h->check_self)
     options |= 1;
-  if (h->rec != NULL)
+  if (NULL != h->rec)
     options |= 2;
   s.options = htonl (options);
   s.self = h->self;
@@ -1178,7 +1332,7 @@ disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h)
 {
   struct GNUNET_TRANSPORT_TransmitHandle *th;
 
-  GNUNET_assert (h->reconnect_task == NULL);
+  GNUNET_assert (NULL == h->reconnect_task);
   if (NULL != h->cth)
   {
     GNUNET_CLIENT_notify_transmit_ready_cancel (h->cth);
@@ -1588,16 +1742,16 @@ GNUNET_TRANSPORT_set_traffic_metric (struct GNUNET_TRANSPORT_Handle *handle,
  * @param cont continuation to call when HELLO has been sent,
  *     tc reason #GNUNET_SCHEDULER_REASON_TIMEOUT for fail
  *     tc reasong #GNUNET_SCHEDULER_REASON_READ_READY for success
- * @param cls closure for continuation
+ * @param cont_cls closure for @a cont
  * @return a `struct GNUNET_TRANSPORT_OfferHelloHandle` handle or NULL on failure,
- *      in case of failure cont will not be called
+ *      in case of failure @a cont will not be called
  *
  */
 struct GNUNET_TRANSPORT_OfferHelloHandle *
 GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
                               const struct GNUNET_MessageHeader *hello,
                               GNUNET_SCHEDULER_TaskCallback cont,
-                              void *cls)
+                              void *cont_cls)
 {
   struct GNUNET_TRANSPORT_OfferHelloHandle *ohh;
   struct GNUNET_MessageHeader *msg;
@@ -1626,11 +1780,15 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle,
   ohh = GNUNET_new (struct GNUNET_TRANSPORT_OfferHelloHandle);
   ohh->th = handle;
   ohh->cont = cont;
-  ohh->cls = cls;
+  ohh->cls = cont_cls;
   ohh->msg = msg;
-  ohh->tth = schedule_control_transmit (handle, size,
-                                        &send_hello, ohh);
-  GNUNET_CONTAINER_DLL_insert (handle->oh_head, handle->oh_tail, ohh);
+  ohh->tth = schedule_control_transmit (handle,
+                                        size,
+                                        &send_hello,
+                                        ohh);
+  GNUNET_CONTAINER_DLL_insert (handle->oh_head,
+                               handle->oh_tail,
+                               ohh);
   return ohh;
 }
 
@@ -1845,17 +2003,17 @@ GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle)
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Transport disconnect called!\n");
   /* this disconnects all neighbours... */
-  if (handle->reconnect_task == NULL)
+  if (NULL == handle->reconnect_task)
     disconnect_and_schedule_reconnect (handle);
   /* and now we stop trying to connect again... */
-  if (handle->reconnect_task != NULL)
+  if (NULL != handle->reconnect_task)
   {
     GNUNET_SCHEDULER_cancel (handle->reconnect_task);
     handle->reconnect_task = NULL;
   }
   GNUNET_CONTAINER_multipeermap_destroy (handle->neighbours);
   handle->neighbours = NULL;
-  if (handle->quota_task != NULL)
+  if (NULL != handle->quota_task)
   {
     GNUNET_SCHEDULER_cancel (handle->quota_task);
     handle->quota_task = NULL;
@@ -1921,6 +2079,7 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle,
   th->neighbour = n;
   th->notify = notify;
   th->notify_cls = notify_cls;
+  th->request_start = GNUNET_TIME_absolute_get ();
   th->timeout = GNUNET_TIME_relative_to_absolute (timeout);
   th->notify_size = size;
   n->th = th;
@@ -1930,7 +2089,7 @@ GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle,
   n->traffic_overhead = 0;
   if (delay.rel_value_us > timeout.rel_value_us)
     delay.rel_value_us = 0;        /* notify immediately (with failure) */
-  if (delay.rel_value_us > GNUNET_TIME_UNIT_SECONDS.rel_value_us)
+  if (delay.rel_value_us > GNUNET_CONSTANTS_LATENCY_WARN.rel_value_us)
     LOG (GNUNET_ERROR_TYPE_WARNING,
          "At bandwidth %u byte/s next transmission to %s in %s\n",
          (unsigned int) n->out_tracker.available_bytes_per_s__,