diff options
Diffstat (limited to 'src/cadet/test_cadeT_util.c')
-rw-r--r-- | src/cadet/test_cadeT_util.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/cadet/test_cadeT_util.c b/src/cadet/test_cadeT_util.c index f2082a006..bf65aca32 100644 --- a/src/cadet/test_cadeT_util.c +++ b/src/cadet/test_cadeT_util.c | |||
@@ -41,6 +41,11 @@ static struct GNUNET_TESTBED_Operation *testbed_info_req[REQUESTED_PEERS]; | |||
41 | static struct GNUNET_HashCode hashed_portname; | 41 | static struct GNUNET_HashCode hashed_portname; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Port handle. | ||
45 | */ | ||
46 | struct GNUNET_CADET_Port *port; | ||
47 | |||
48 | /** | ||
44 | * Result of the test. | 49 | * Result of the test. |
45 | */ | 50 | */ |
46 | int test_result = 0; | 51 | int test_result = 0; |
@@ -78,6 +83,9 @@ disconnect_from_peer (void *cls, | |||
78 | 83 | ||
79 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); | 84 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", __func__); |
80 | 85 | ||
86 | if (0 == strncmp ("listening_peer", cls, sizeof (cls))) | ||
87 | GNUNET_CADET_close_port (port); | ||
88 | |||
81 | GNUNET_CADET_disconnect (cadet); | 89 | GNUNET_CADET_disconnect (cadet); |
82 | } | 90 | } |
83 | 91 | ||
@@ -120,6 +128,7 @@ handle_port_connects (void *cls, | |||
120 | struct GNUNET_CADET_Channel *channel, | 128 | struct GNUNET_CADET_Channel *channel, |
121 | const struct GNUNET_PeerIdentity *source) | 129 | const struct GNUNET_PeerIdentity *source) |
122 | { | 130 | { |
131 | test_peers[1].channel = channel; | ||
123 | return NULL; | 132 | return NULL; |
124 | } | 133 | } |
125 | 134 | ||
@@ -134,12 +143,11 @@ setup_listening_peer (void *cls, | |||
134 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 143 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
135 | { | 144 | { |
136 | struct GNUNET_CADET_Handle *cadet; | 145 | struct GNUNET_CADET_Handle *cadet; |
137 | struct GNUNET_CADET_Port *port; | ||
138 | struct GNUNET_MQ_MessageHandler msg_handlers[] = { | 146 | struct GNUNET_MQ_MessageHandler msg_handlers[] = { |
139 | GNUNET_MQ_hd_fixed_size (message, | 147 | GNUNET_MQ_hd_var_size (message, |
140 | GNUNET_MESSAGE_TYPE_DUMMY, | 148 | GNUNET_MESSAGE_TYPE_DUMMY, |
141 | struct GNUNET_MessageHeader, | 149 | struct GNUNET_MessageHeader, |
142 | NULL), | 150 | NULL), |
143 | GNUNET_MQ_handler_end () | 151 | GNUNET_MQ_handler_end () |
144 | }; | 152 | }; |
145 | 153 | ||
@@ -198,13 +206,13 @@ connect_to_service (void *cb_cls, | |||
198 | "cadet", | 206 | "cadet", |
199 | &check_test_readyness, NULL, | 207 | &check_test_readyness, NULL, |
200 | &setup_listening_peer, | 208 | &setup_listening_peer, |
201 | &disconnect_from_peer, NULL); | 209 | &disconnect_from_peer, "listening_peer"); |
202 | testbed_to_svc[0] = | 210 | testbed_to_svc[0] = |
203 | GNUNET_TESTBED_service_connect (NULL, test_peers[0].testbed_peer, | 211 | GNUNET_TESTBED_service_connect (NULL, test_peers[0].testbed_peer, |
204 | "cadet", | 212 | "cadet", |
205 | &check_test_readyness, NULL, | 213 | &check_test_readyness, NULL, |
206 | &setup_initiating_peer, | 214 | &setup_initiating_peer, |
207 | &disconnect_from_peer, NULL); | 215 | &disconnect_from_peer, "initiating_peer"); |
208 | } | 216 | } |
209 | } | 217 | } |
210 | 218 | ||