diff options
-rw-r--r-- | src/mesh/test_mesh_local_1.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/mesh/test_mesh_local_1.c b/src/mesh/test_mesh_local_1.c index 7ccab0916..4e8d0b78e 100644 --- a/src/mesh/test_mesh_local_1.c +++ b/src/mesh/test_mesh_local_1.c | |||
@@ -36,6 +36,8 @@ static struct GNUNET_OS_Process *arm_pid; | |||
36 | static struct GNUNET_MESH_Handle *mesh_peer_1; | 36 | static struct GNUNET_MESH_Handle *mesh_peer_1; |
37 | static struct GNUNET_MESH_Handle *mesh_peer_2; | 37 | static struct GNUNET_MESH_Handle *mesh_peer_2; |
38 | static struct GNUNET_MESH_Tunnel *t; | 38 | static struct GNUNET_MESH_Tunnel *t; |
39 | static int one = 1; | ||
40 | static int two = 2; | ||
39 | 41 | ||
40 | static int result; | 42 | static int result; |
41 | static GNUNET_SCHEDULER_TaskIdentifier abort_task; | 43 | static GNUNET_SCHEDULER_TaskIdentifier abort_task; |
@@ -132,7 +134,7 @@ inbound_tunnel (void *cls, struct GNUNET_MESH_Tunnel *tunnel, | |||
132 | const struct GNUNET_PeerIdentity *initiator, | 134 | const struct GNUNET_PeerIdentity *initiator, |
133 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) | 135 | const struct GNUNET_TRANSPORT_ATS_Information *atsi) |
134 | { | 136 | { |
135 | unsigned int id = (unsigned int) cls; | 137 | unsigned int id = *(unsigned int *) cls; |
136 | 138 | ||
137 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: received incoming tunnel\n"); | 139 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: received incoming tunnel\n"); |
138 | if (id != 1) | 140 | if (id != 1) |
@@ -159,7 +161,7 @@ inbound_end (void *cls, | |||
159 | const struct GNUNET_MESH_Tunnel * tunnel, | 161 | const struct GNUNET_MESH_Tunnel * tunnel, |
160 | void *tunnel_ctx) | 162 | void *tunnel_ctx) |
161 | { | 163 | { |
162 | unsigned int id = (unsigned int) cls; | 164 | unsigned int id = *(unsigned int *) cls; |
163 | 165 | ||
164 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: incoming tunnel closed\n"); | 166 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: incoming tunnel closed\n"); |
165 | if (id != 1) | 167 | if (id != 1) |
@@ -179,7 +181,8 @@ inbound_end (void *cls, | |||
179 | */ | 181 | */ |
180 | static void peer_conected ( | 182 | static void peer_conected ( |
181 | void *cls, | 183 | void *cls, |
182 | const struct GNUNET_PeerIdentity * peer) | 184 | const struct GNUNET_PeerIdentity * peer, |
185 | const struct GNUNET_TRANSPORT_ATS_Information * atsi) | ||
183 | { | 186 | { |
184 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer connected\n"); | 187 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer connected\n"); |
185 | GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, &do_shutdown, NULL); | 188 | GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, &do_shutdown, NULL); |
@@ -195,8 +198,7 @@ static void peer_conected ( | |||
195 | */ | 198 | */ |
196 | static void peer_disconnected ( | 199 | static void peer_disconnected ( |
197 | void *cls, | 200 | void *cls, |
198 | const struct GNUNET_PeerIdentity * peer, | 201 | const struct GNUNET_PeerIdentity * peer) |
199 | const struct GNUNET_TRANSPORT_ATS_Information * atsi) | ||
200 | { | 202 | { |
201 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer disconnected\n"); | 203 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: peer disconnected\n"); |
202 | } | 204 | } |
@@ -240,7 +242,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
240 | test_task = GNUNET_SCHEDULER_NO_TASK; | 242 | test_task = GNUNET_SCHEDULER_NO_TASK; |
241 | mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */ | 243 | mesh_peer_1 = GNUNET_MESH_connect (cfg, /* configuration */ |
242 | 10, /* queue size */ | 244 | 10, /* queue size */ |
243 | (void *) 1, /* cls */ | 245 | (void *) &one, /* cls */ |
244 | &inbound_tunnel, /* inbound new hndlr */ | 246 | &inbound_tunnel, /* inbound new hndlr */ |
245 | &inbound_end, /* inbound end hndlr */ | 247 | &inbound_end, /* inbound end hndlr */ |
246 | handlers1, /* traffic handlers */ | 248 | handlers1, /* traffic handlers */ |
@@ -248,7 +250,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
248 | 250 | ||
249 | mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */ | 251 | mesh_peer_2 = GNUNET_MESH_connect (cfg, /* configuration */ |
250 | 10, /* queue size */ | 252 | 10, /* queue size */ |
251 | (void *) 2, /* cls */ | 253 | (void *) &two, /* cls */ |
252 | &inbound_tunnel, /* inbound new hndlr */ | 254 | &inbound_tunnel, /* inbound new hndlr */ |
253 | &inbound_end, /* inbound end hndlr */ | 255 | &inbound_end, /* inbound end hndlr */ |
254 | handlers2, /* traffic handlers */ | 256 | handlers2, /* traffic handlers */ |
@@ -267,7 +269,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
267 | NULL, | 269 | NULL, |
268 | &peer_conected, | 270 | &peer_conected, |
269 | &peer_disconnected, | 271 | &peer_disconnected, |
270 | (void *) 2); | 272 | (void *) &two); |
271 | GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, &do_find, NULL); | 273 | GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_SECONDS, &do_find, NULL); |
272 | } | 274 | } |
273 | 275 | ||