aboutsummaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api_unreliability.c
diff options
context:
space:
mode:
authorMatthias Wachs <wachs@net.in.tum.de>2011-06-17 11:53:17 +0000
committerMatthias Wachs <wachs@net.in.tum.de>2011-06-17 11:53:17 +0000
commit976473839da8f1978ea31015339858927d0bdbd2 (patch)
tree4892e35713222a1849c3442713d5cdaab04f4b36 /src/transport/test_transport_api_unreliability.c
parentea8801774f9dcc2bbe7c7f61c4686d80b7e4d365 (diff)
downloadgnunet-976473839da8f1978ea31015339858927d0bdbd2.tar.gz
gnunet-976473839da8f1978ea31015339858927d0bdbd2.zip
Diffstat (limited to 'src/transport/test_transport_api_unreliability.c')
-rw-r--r--src/transport/test_transport_api_unreliability.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/transport/test_transport_api_unreliability.c b/src/transport/test_transport_api_unreliability.c
index 2101def80..90a53c2b8 100644
--- a/src/transport/test_transport_api_unreliability.c
+++ b/src/transport/test_transport_api_unreliability.c
@@ -91,6 +91,8 @@ static GNUNET_SCHEDULER_TaskIdentifier die_task;
91 91
92static GNUNET_SCHEDULER_TaskIdentifier tct; 92static GNUNET_SCHEDULER_TaskIdentifier tct;
93 93
94struct GNUNET_TRANSPORT_TransmitHandle * th_p2;
95
94static char *key_file_p1; 96static char *key_file_p1;
95static char *cert_file_p1; 97static char *cert_file_p1;
96 98
@@ -167,6 +169,10 @@ end ()
167#if VERBOSE 169#if VERBOSE
168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n"); 170 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
169#endif 171#endif
172 if (th_p2 != NULL)
173 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
174 th_p2 = NULL;
175
170 GNUNET_TRANSPORT_disconnect (p1.th); 176 GNUNET_TRANSPORT_disconnect (p1.th);
171 GNUNET_TRANSPORT_disconnect (p2.th); 177 GNUNET_TRANSPORT_disconnect (p2.th);
172#if VERBOSE 178#if VERBOSE
@@ -205,6 +211,9 @@ end_unreliably ()
205#if VERBOSE 211#if VERBOSE
206 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n"); 212 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
207#endif 213#endif
214 if (th_p2 != NULL)
215 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
216
208 GNUNET_TRANSPORT_disconnect (p1.th); 217 GNUNET_TRANSPORT_disconnect (p1.th);
209 GNUNET_TRANSPORT_disconnect (p2.th); 218 GNUNET_TRANSPORT_disconnect (p2.th);
210#if VERBOSE 219#if VERBOSE
@@ -253,6 +262,11 @@ end_badly (void *cls,
253 msg_recv, 262 msg_recv,
254 msg_recv_expected); 263 msg_recv_expected);
255 GNUNET_break (0); 264 GNUNET_break (0);
265
266 if (th_p2 != NULL)
267 GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
268 th_p2 = NULL;
269
256 GNUNET_TRANSPORT_disconnect (p1.th); 270 GNUNET_TRANSPORT_disconnect (p1.th);
257 GNUNET_TRANSPORT_disconnect (p2.th); 271 GNUNET_TRANSPORT_disconnect (p2.th);
258 272
@@ -361,6 +375,8 @@ notify_ready (void *cls, size_t size, void *buf)
361 unsigned int s; 375 unsigned int s;
362 unsigned int ret; 376 unsigned int ret;
363 377
378 th_p2 = NULL;
379
364 if (buf == NULL) 380 if (buf == NULL)
365 { 381 {
366 GNUNET_break (0); 382 GNUNET_break (0);
@@ -399,7 +415,7 @@ notify_ready (void *cls, size_t size, void *buf)
399 while (size - ret >= s); 415 while (size - ret >= s);
400 if (n < TOTAL_MSGS) 416 if (n < TOTAL_MSGS)
401 { 417 {
402 GNUNET_TRANSPORT_notify_transmit_ready (p2.th, 418 th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
403 &p1.id, 419 &p1.id,
404 s, 0, TIMEOUT, 420 s, 0, TIMEOUT,
405 &notify_ready, 421 &notify_ready,