[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r31218 - gnunet/src/transport
From: |
gnunet |
Subject: |
[GNUnet-SVN] r31218 - gnunet/src/transport |
Date: |
Mon, 9 Dec 2013 15:39:30 +0100 |
Author: grothoff
Date: 2013-12-09 15:39:30 +0100 (Mon, 09 Dec 2013)
New Revision: 31218
Modified:
gnunet/src/transport/gnunet-service-transport_neighbours.c
Log:
-doxygen, indentation fixes
Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c 2013-12-09
14:29:39 UTC (rev 31217)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c 2013-12-09
14:39:30 UTC (rev 31218)
@@ -1147,7 +1147,9 @@
GNUNET_assert (0);
break;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
break;
}
@@ -1654,7 +1656,7 @@
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Creating new neighbour entry for `%s'\n",
GNUNET_i2s (peer));
- n = GNUNET_malloc (sizeof (struct NeighbourMapEntry));
+ n = GNUNET_new (struct NeighbourMapEntry);
n->id = *peer;
n->state = S_NOT_CONNECTED;
n->latency = GNUNET_TIME_UNIT_FOREVER_REL;
@@ -1768,7 +1770,9 @@
/* should not be possible */
GNUNET_assert (0);
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s'
\n",print_state (n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
free_neighbour (n, GNUNET_NO);
break;
@@ -1989,7 +1993,9 @@
GNUNET_assert (0);
break;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
free_neighbour (n, GNUNET_NO);
break;
@@ -2142,7 +2148,9 @@
GNUNET_assert (0);
break;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
free_neighbour (n, GNUNET_NO);
break;
@@ -2370,16 +2378,19 @@
GNUNET_assert (0);
break;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
break;
}
}
+
static int
send_utilization_data (void *cls,
- const struct GNUNET_PeerIdentity *key,
- void *value)
+ const struct GNUNET_PeerIdentity *key,
+ void *value)
{
struct NeighbourMapEntry *n = value;
struct GNUNET_ATS_Information atsi[4];
@@ -2389,7 +2400,8 @@
uint32_t bps_out;
struct GNUNET_TIME_Relative delta;
- delta = GNUNET_TIME_absolute_get_difference(n->last_util_transmission,
GNUNET_TIME_absolute_get());
+ delta = GNUNET_TIME_absolute_get_difference (n->last_util_transmission,
+ GNUNET_TIME_absolute_get ());
bps_pl_in = 0;
@@ -2398,9 +2410,11 @@
bps_pl_out = 0;
if ((0 != n->util_payload_bytes_sent) && (0 != delta.rel_value_us))
bps_pl_out = (1000LL * 1000LL * n->util_payload_bytes_sent) /
delta.rel_value_us;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' payload: received %u Bytes/s,
sent %u Bytes/s \n",
- GNUNET_i2s (key), bps_pl_in, bps_pl_out);
-
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "`%s' payload: received %u Bytes/s, sent %u Bytes/s\n",
+ GNUNET_i2s (key),
+ bps_pl_in,
+ bps_pl_out);
bps_in = 0;
if ((0 != n->util_total_bytes_recv) && (0 != delta.rel_value_us))
bps_in = (1000LL * 1000LL * n->util_total_bytes_recv) /
(delta.rel_value_us);
@@ -2409,9 +2423,11 @@
bps_out = (1000LL * 1000LL * n->util_total_bytes_sent) /
delta.rel_value_us;
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' total: received %u Bytes/s, sent
%u Bytes/s \n",
- GNUNET_i2s (key), bps_in, bps_out);
-
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "`%s' total: received %u Bytes/s, sent %u Bytes/s\n",
+ GNUNET_i2s (key),
+ bps_in,
+ bps_out);
atsi[0].type = htonl (GNUNET_ATS_UTILIZATION_OUT);
atsi[0].value = htonl (bps_out);
atsi[1].type = htonl (GNUNET_ATS_UTILIZATION_IN);
@@ -2432,6 +2448,7 @@
return GNUNET_OK;
}
+
/**
* Task transmitting utilization in a regular interval
*
@@ -2695,7 +2712,9 @@
GNUNET_assert (0);
break;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
break;
}
@@ -2868,7 +2887,9 @@
GNUNET_assert (0);
break;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
break;
}
@@ -2994,7 +3015,9 @@
return GNUNET_NO;
break;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
break;
}
@@ -3322,7 +3345,9 @@
case S_DISCONNECT_FINISHED:
return GNUNET_TIME_UNIT_FOREVER_REL;
default:
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unhandled state `%s' \n",print_state
(n->state));
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Unhandled state `%s'\n",
+ print_state (n->state));
GNUNET_break (0);
break;
}
@@ -3381,7 +3406,7 @@
* @param cls unused
* @param key hash of neighbour's public key (not used)
* @param value the 'struct NeighbourMapEntry' of the neighbour
- * @return GNUNET_OK (continue to iterate)
+ * @return #GNUNET_OK (continue to iterate)
*/
static int
disconnect_all_neighbours (void *cls,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r31218 - gnunet/src/transport,
gnunet <=