[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r32265 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r32265 - gnunet/src/transport |
Date: |
Sun, 9 Feb 2014 19:58:36 +0100 |
Author: grothoff
Date: 2014-02-09 19:58:36 +0100 (Sun, 09 Feb 2014)
New Revision: 32265
Modified:
gnunet/src/transport/transport_api.c
Log:
-eliminate odd global variable, indentation, doxygen, stylistic fixes
Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c 2014-02-09 18:48:10 UTC (rev
32264)
+++ gnunet/src/transport/transport_api.c 2014-02-09 18:58:36 UTC (rev
32265)
@@ -419,19 +419,26 @@
}
-
+/**
+ * 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);
@@ -517,7 +524,6 @@
return GNUNET_YES;
}
-static int reconnecting;
/**
* Function we use for handling incoming messages.
@@ -544,7 +550,7 @@
uint32_t bytes_physical;
GNUNET_assert (NULL != h->client);
- if (GNUNET_YES == reconnecting)
+ if (GNUNET_YES == h->reconnecting)
{
return;
}
@@ -552,7 +558,7 @@
{
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;
}
@@ -1052,7 +1058,7 @@
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);
@@ -1140,7 +1146,7 @@
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);
@@ -1221,6 +1227,7 @@
GNUNET_free (tch);
}
+
/**
* Send HELLO message to the service.
*
@@ -1359,7 +1366,6 @@
}
-
/**
* Offer the transport service the HELLO of another peer. Note that
* the transport service may just ignore this message if the HELLO is
@@ -1628,10 +1634,10 @@
}
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);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r32265 - gnunet/src/transport,
gnunet <=