aboutsummaryrefslogtreecommitdiff
path: root/src/topology
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
committerChristian Grothoff <christian@grothoff.org>2019-10-31 13:03:48 +0100
commit7e3cf5f461eb4fbb7581672bf0835da07c378136 (patch)
treebdc3874b7894242b095b892f1ed3e81a4d4f06c0 /src/topology
parent01b480d6d026e0c537dc284a7e7df2c0320a3528 (diff)
downloadgnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.tar.gz
gnunet-7e3cf5f461eb4fbb7581672bf0835da07c378136.zip
tighten formatting rules
Diffstat (limited to 'src/topology')
-rw-r--r--src/topology/gnunet-daemon-topology.c8
-rw-r--r--src/topology/test_gnunet_daemon_topology.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 9e662ca0b..1b6004392 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -388,8 +388,7 @@ setup_filter (struct Peer *peer)
388 * of the data structure and would only really become 388 * of the data structure and would only really become
389 * "useless" once a HELLO has been passed on to ~100 389 * "useless" once a HELLO has been passed on to ~100
390 * other peers, which is likely more than enough in 390 * other peers, which is likely more than enough in
391 * any case; hence 64, 5 as bloomfilter parameters. */ 391 * any case; hence 64, 5 as bloomfilter parameters. */peer->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, 64, 5);
392 peer->filter = GNUNET_CONTAINER_bloomfilter_init (NULL, 64, 5);
393 peer->filter_expiration = 392 peer->filter_expiration =
394 GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_REPEAT_FREQUENCY); 393 GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_REPEAT_FREQUENCY);
395 /* never send a peer its own HELLO */ 394 /* never send a peer its own HELLO */
@@ -1142,12 +1141,15 @@ main (int argc, char *const *argv)
1142/** 1141/**
1143 * MINIMIZE heap size (way below 128k) since this process doesn't need much. 1142 * MINIMIZE heap size (way below 128k) since this process doesn't need much.
1144 */ 1143 */
1145void __attribute__ ((constructor)) GNUNET_ARM_memory_init () 1144void __attribute__ ((constructor))
1145GNUNET_ARM_memory_init ()
1146{ 1146{
1147 mallopt (M_TRIM_THRESHOLD, 4 * 1024); 1147 mallopt (M_TRIM_THRESHOLD, 4 * 1024);
1148 mallopt (M_TOP_PAD, 1 * 1024); 1148 mallopt (M_TOP_PAD, 1 * 1024);
1149 malloc_trim (0); 1149 malloc_trim (0);
1150} 1150}
1151
1152
1151#endif 1153#endif
1152 1154
1153/* end of gnunet-daemon-topology.c */ 1155/* end of gnunet-daemon-topology.c */
diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c
index f6d0e2c2b..a7dace383 100644
--- a/src/topology/test_gnunet_daemon_topology.c
+++ b/src/topology/test_gnunet_daemon_topology.c
@@ -98,6 +98,7 @@ shutdown_task (void *cls)
98 GNUNET_SCHEDULER_cancel (timeout_tid); 98 GNUNET_SCHEDULER_cancel (timeout_tid);
99} 99}
100 100
101
101static void 102static void
102timeout_task (void *cls) 103timeout_task (void *cls)
103{ 104{
@@ -109,6 +110,7 @@ timeout_task (void *cls)
109 GNUNET_SCHEDULER_shutdown (); 110 GNUNET_SCHEDULER_shutdown ();
110} 111}
111 112
113
112/* 114/*
113 * The function is called every time the topology of connected 115 * The function is called every time the topology of connected
114 * peers to a peer changes. 116 * peers to a peer changes.
@@ -131,7 +133,7 @@ statistics_iterator (void *cls,
131 if (p_ctx->connections < value) 133 if (p_ctx->connections < value)
132 p_ctx->connections = value; 134 p_ctx->connections = value;
133 135
134 if ((THRESHOLD <= value)&&(GNUNET_NO == p_ctx->reported)) 136 if ((THRESHOLD <= value) && (GNUNET_NO == p_ctx->reported))
135 { 137 {
136 p_ctx->reported = GNUNET_YES; 138 p_ctx->reported = GNUNET_YES;
137 checked_peers++; 139 checked_peers++;
@@ -153,6 +155,7 @@ statistics_iterator (void *cls,
153 return GNUNET_YES; 155 return GNUNET_YES;
154} 156}
155 157
158
156static void * 159static void *
157ca_statistics (void *cls, 160ca_statistics (void *cls,
158 const struct GNUNET_CONFIGURATION_Handle *cfg) 161 const struct GNUNET_CONFIGURATION_Handle *cfg)
@@ -203,6 +206,7 @@ service_connect_complete (void *cls,
203 "call to GNUNET_STATISTICS_watch() failed\n"); 206 "call to GNUNET_STATISTICS_watch() failed\n");
204} 207}
205 208
209
206static void 210static void
207notify_connect_complete (void *cls, 211notify_connect_complete (void *cls,
208 struct GNUNET_TESTBED_Operation *op, 212 struct GNUNET_TESTBED_Operation *op,
@@ -219,6 +223,7 @@ notify_connect_complete (void *cls,
219 connect_left--; 223 connect_left--;
220} 224}
221 225
226
222static void 227static void
223do_connect (void *cls, 228do_connect (void *cls,
224 struct GNUNET_TESTBED_RunHandle *h, 229 struct GNUNET_TESTBED_RunHandle *h,
@@ -286,4 +291,5 @@ main (int argc, char *argv[])
286 return (GNUNET_OK != result) ? 1 : 0; 291 return (GNUNET_OK != result) ? 1 : 0;
287} 292}
288 293
294
289/* end of test_gnunet_daemon_topology.c */ 295/* end of test_gnunet_daemon_topology.c */