diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2011-11-07 12:54:33 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2011-11-07 12:54:33 +0000 |
commit | 18bc4a4c2993dc9962bf62b6b375921282246b86 (patch) | |
tree | 047188c75219dd9eb06fc65e79dc5913c304d7e1 /src/transport/transport-testing.c | |
parent | 2594f29af1da0339927a32165f71ae33198d2b9d (diff) | |
download | gnunet-18bc4a4c2993dc9962bf62b6b375921282246b86.tar.gz gnunet-18bc4a4c2993dc9962bf62b6b375921282246b86.zip |
new test to test bi-directional connection attempts
Diffstat (limited to 'src/transport/transport-testing.c')
-rw-r--r-- | src/transport/transport-testing.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index fc1eaf556..fb7535750 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #include "transport-testing.h" | 28 | #include "transport-testing.h" |
29 | 29 | ||
30 | #define VERBOSE GNUNET_YES | 30 | #define VERBOSE GNUNET_EXTRA_LOGGING |
31 | 31 | ||
32 | 32 | ||
33 | static struct PeerContext * | 33 | static struct PeerContext * |
@@ -170,8 +170,10 @@ get_hello (void *cb_cls, const struct GNUNET_MessageHeader *message) | |||
170 | GNUNET_assert (GNUNET_OK == | 170 | GNUNET_assert (GNUNET_OK == |
171 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) | 171 | GNUNET_HELLO_get_id ((const struct GNUNET_HELLO_Message *) |
172 | message, &p->id)); | 172 | message, &p->id)); |
173 | #if VERBOSE | ||
173 | size_t size = | 174 | size_t size = |
174 | GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message *) message); | 175 | GNUNET_HELLO_size ((const struct GNUNET_HELLO_Message *) message); |
176 | #endif | ||
175 | GNUNET_free_non_null (p->hello); | 177 | GNUNET_free_non_null (p->hello); |
176 | p->hello = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (message); | 178 | p->hello = (struct GNUNET_HELLO_Message *) GNUNET_copy_message (message); |
177 | 179 | ||
@@ -349,7 +351,8 @@ GNUNET_TRANSPORT_TESTING_stop_peer (struct GNUNET_TRANSPORT_TESTING_handle *tth, | |||
349 | * @param p1 peer 1 | 351 | * @param p1 peer 1 |
350 | * @param p2 peer 2 | 352 | * @param p2 peer 2 |
351 | * @param cb the callback to call when both peers notified that they are connected | 353 | * @param cb the callback to call when both peers notified that they are connected |
352 | * @param cb_cls callback cls | 354 | * @param cb_cls callback cls (or a pointer to the |
355 | * GNUNET_TRANSPORT_TESTING_ConnectRequest itself if null) | ||
353 | * @return connect context | 356 | * @return connect context |
354 | */ | 357 | */ |
355 | GNUNET_TRANSPORT_TESTING_ConnectRequest | 358 | GNUNET_TRANSPORT_TESTING_ConnectRequest |
@@ -371,7 +374,10 @@ GNUNET_TRANSPORT_TESTING_connect_peers (struct GNUNET_TRANSPORT_TESTING_handle | |||
371 | cc->p2 = p2; | 374 | cc->p2 = p2; |
372 | 375 | ||
373 | cc->cb = cb; | 376 | cc->cb = cb; |
374 | cc->cb_cls = cb_cls; | 377 | if (cb_cls != NULL) |
378 | cc->cb_cls = cb_cls; | ||
379 | else | ||
380 | cc->cb_cls = cc; | ||
375 | 381 | ||
376 | cc->th_p1 = p1->th; | 382 | cc->th_p1 = p1->th; |
377 | cc->th_p2 = p2->th; | 383 | cc->th_p2 = p2->th; |