}
-
+/**
+ * The outbound quota has changed in a way that may require
+ * us to reset the timeout. Update the timeout.
+ *
+ * @param cls the `struct Neighbour` for which the timeout changed
+ */
static void
outbound_bw_tracker_update (void *cls)
{
struct Neighbour *n = cls;
struct GNUNET_TIME_Relative delay;
+
if (NULL == n->hn)
return;
-
delay = GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker,
n->th->notify_size + n->traffic_overhead);
- LOG(GNUNET_ERROR_TYPE_DEBUG,
- "New outbound delay %llu us\n",delay.rel_value_us);
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "New outbound delay %llu us\n",
+ GNUNET_STRINGS_relative_time_to_string (delay,
+ GNUNET_NO));
GNUNET_CONTAINER_heap_update_cost (n->h->ready_heap,
n->hn, delay.rel_value_us);
schedule_transmission (n->h);
return GNUNET_YES;
}
-static int reconnecting;
/**
* Function we use for handling incoming messages.
uint32_t bytes_physical;
GNUNET_assert (NULL != h->client);
- if (GNUNET_YES == reconnecting)
+ if (GNUNET_YES == h->reconnecting)
{
return;
}
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Error receiving from transport service, disconnecting temporarily.\n");
- reconnecting = GNUNET_YES;
+ h->reconnecting = GNUNET_YES;
disconnect_and_schedule_reconnect (h);
return;
}
GNUNET_assert (NULL == h->client);
GNUNET_assert (NULL == h->control_head);
GNUNET_assert (NULL == h->control_tail);
- reconnecting = GNUNET_NO;
+ h->reconnecting = GNUNET_NO;
h->client = GNUNET_CLIENT_connect ("transport", h->cfg);
GNUNET_assert (NULL != h->client);
struct GNUNET_TRANSPORT_TryConnectHandle *tch = cls;
struct TransportRequestConnectMessage msg;
- if (buf == NULL)
+ if (NULL == buf)
{
if (NULL != tch->cb)
tch->cb (tch->cb_cls, GNUNET_SYSERR);
GNUNET_free (tch);
}
+
/**
* Send HELLO message to the service.
*
}
-
/**
* Offer the transport service the HELLO of another peer. Note that
* the transport service may just ignore this message if the HELLO is
}
GNUNET_free_non_null (handle->my_hello);
handle->my_hello = NULL;
- GNUNET_assert (handle->tc_head == NULL);
- GNUNET_assert (handle->tc_tail == NULL);
- GNUNET_assert (handle->hwl_head == NULL);
- GNUNET_assert (handle->hwl_tail == NULL);
+ GNUNET_assert (NULL == handle->tc_head);
+ GNUNET_assert (NULL == handle->tc_tail);
+ GNUNET_assert (NULL == handle->hwl_head);
+ GNUNET_assert (NULL == handle->hwl_tail);
GNUNET_CONTAINER_heap_destroy (handle->ready_heap);
handle->ready_heap = NULL;
GNUNET_free (handle);