diff options
Diffstat (limited to 'src/transport/transport-testing.c')
-rw-r--r-- | src/transport/transport-testing.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index ae878a79e..322627459 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -186,7 +186,7 @@ get_hello (void *cb_cls, | |||
186 | p->no, | 186 | p->no, |
187 | GNUNET_i2s (&p->id)); | 187 | GNUNET_i2s (&p->id)); |
188 | p->start_cb (p, | 188 | p->start_cb (p, |
189 | p->cb_cls); | 189 | p->start_cb_cls); |
190 | p->start_cb = NULL; | 190 | p->start_cb = NULL; |
191 | } | 191 | } |
192 | } | 192 | } |
@@ -200,8 +200,9 @@ get_hello (void *cb_cls, | |||
200 | * @param rec receive callback | 200 | * @param rec receive callback |
201 | * @param nc connect callback | 201 | * @param nc connect callback |
202 | * @param nd disconnect callback | 202 | * @param nd disconnect callback |
203 | * @param start_cb start callback | ||
204 | * @param cb_cls closure for callback | 203 | * @param cb_cls closure for callback |
204 | * @param start_cb start callback | ||
205 | * @param start_cb_cls closure for callback | ||
205 | * @return the peer context | 206 | * @return the peer context |
206 | */ | 207 | */ |
207 | struct GNUNET_TRANSPORT_TESTING_PeerContext * | 208 | struct GNUNET_TRANSPORT_TESTING_PeerContext * |
@@ -211,8 +212,9 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_Handle *tth | |||
211 | GNUNET_TRANSPORT_ReceiveCallback rec, | 212 | GNUNET_TRANSPORT_ReceiveCallback rec, |
212 | GNUNET_TRANSPORT_NotifyConnect nc, | 213 | GNUNET_TRANSPORT_NotifyConnect nc, |
213 | GNUNET_TRANSPORT_NotifyDisconnect nd, | 214 | GNUNET_TRANSPORT_NotifyDisconnect nd, |
215 | void *cb_cls, | ||
214 | GNUNET_TRANSPORT_TESTING_StartCallback start_cb, | 216 | GNUNET_TRANSPORT_TESTING_StartCallback start_cb, |
215 | void *cb_cls) | 217 | void *start_cb_cls) |
216 | { | 218 | { |
217 | char *emsg = NULL; | 219 | char *emsg = NULL; |
218 | struct GNUNET_TRANSPORT_TESTING_PeerContext *p; | 220 | struct GNUNET_TRANSPORT_TESTING_PeerContext *p; |
@@ -231,11 +233,12 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_Handle *tth | |||
231 | p->nc = nc; | 233 | p->nc = nc; |
232 | p->nd = nd; | 234 | p->nd = nd; |
233 | p->rec = rec; | 235 | p->rec = rec; |
234 | p->start_cb = start_cb; | 236 | if (NULL != cb_cls) |
235 | if (cb_cls != NULL) | ||
236 | p->cb_cls = cb_cls; | 237 | p->cb_cls = cb_cls; |
237 | else | 238 | else |
238 | p->cb_cls = p; | 239 | p->cb_cls = p; |
240 | p->start_cb = start_cb; | ||
241 | p->start_cb_cls = start_cb_cls; | ||
239 | GNUNET_CONTAINER_DLL_insert (tth->p_head, | 242 | GNUNET_CONTAINER_DLL_insert (tth->p_head, |
240 | tth->p_tail, | 243 | tth->p_tail, |
241 | p); | 244 | p); |
@@ -341,13 +344,13 @@ GNUNET_TRANSPORT_TESTING_start_peer (struct GNUNET_TRANSPORT_TESTING_Handle *tth | |||
341 | * | 344 | * |
342 | * @param p the peer | 345 | * @param p the peer |
343 | * @param restart_cb callback to call when restarted | 346 | * @param restart_cb callback to call when restarted |
344 | * @param cb_cls callback closure | 347 | * @param restart_cb_cls callback closure |
345 | * @return #GNUNET_OK in success otherwise #GNUNET_SYSERR | 348 | * @return #GNUNET_OK in success otherwise #GNUNET_SYSERR |
346 | */ | 349 | */ |
347 | int | 350 | int |
348 | GNUNET_TRANSPORT_TESTING_restart_peer (struct GNUNET_TRANSPORT_TESTING_PeerContext *p, | 351 | GNUNET_TRANSPORT_TESTING_restart_peer (struct GNUNET_TRANSPORT_TESTING_PeerContext *p, |
349 | GNUNET_TRANSPORT_TESTING_StartCallback restart_cb, | 352 | GNUNET_TRANSPORT_TESTING_StartCallback restart_cb, |
350 | void *cb_cls) | 353 | void *restart_cb_cls) |
351 | { | 354 | { |
352 | /* shutdown */ | 355 | /* shutdown */ |
353 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 356 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -397,7 +400,7 @@ GNUNET_TRANSPORT_TESTING_restart_peer (struct GNUNET_TRANSPORT_TESTING_PeerConte | |||
397 | 400 | ||
398 | GNUNET_assert (NULL == p->start_cb); | 401 | GNUNET_assert (NULL == p->start_cb); |
399 | p->start_cb = restart_cb; | 402 | p->start_cb = restart_cb; |
400 | p->cb_cls = cb_cls; | 403 | p->start_cb_cls = restart_cb_cls; |
401 | 404 | ||
402 | p->th = GNUNET_TRANSPORT_connect (p->cfg, | 405 | p->th = GNUNET_TRANSPORT_connect (p->cfg, |
403 | NULL, | 406 | NULL, |