diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-12-02 11:59:56 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-12-02 11:59:56 +0000 |
commit | 614afe91d2c80b6fec4e6a090319c1a585944d75 (patch) | |
tree | ecd31dde4d596ec9c63fb5efde6243866c24bdc4 /src/transport/test_transport_api.c | |
parent | 318e4c9274fefbb546363633ea465f9f339cb828 (diff) | |
download | gnunet-614afe91d2c80b6fec4e6a090319c1a585944d75.tar.gz gnunet-614afe91d2c80b6fec4e6a090319c1a585944d75.zip |
Working version of transport service with ATS integration
all tests passing on my machine
Diffstat (limited to 'src/transport/test_transport_api.c')
-rw-r--r-- | src/transport/test_transport_api.c | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index 1f9c56974..f05b3cb5d 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c | |||
@@ -82,8 +82,6 @@ static int is_http; | |||
82 | 82 | ||
83 | static int is_https; | 83 | static int is_https; |
84 | 84 | ||
85 | static int is_multi_protocol; | ||
86 | |||
87 | static GNUNET_SCHEDULER_TaskIdentifier die_task; | 85 | static GNUNET_SCHEDULER_TaskIdentifier die_task; |
88 | 86 | ||
89 | static char * key_file_p1; | 87 | static char * key_file_p1; |
@@ -142,7 +140,8 @@ static void | |||
142 | notify_receive (void *cls, | 140 | notify_receive (void *cls, |
143 | const struct GNUNET_PeerIdentity *peer, | 141 | const struct GNUNET_PeerIdentity *peer, |
144 | const struct GNUNET_MessageHeader *message, | 142 | const struct GNUNET_MessageHeader *message, |
145 | const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count) | 143 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
144 | uint32_t ats_count) | ||
146 | { | 145 | { |
147 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok is (%d)!\n", | 146 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok is (%d)!\n", |
148 | ok); | 147 | ok); |
@@ -187,7 +186,8 @@ notify_ready (void *cls, size_t size, void *buf) | |||
187 | static void | 186 | static void |
188 | notify_connect (void *cls, | 187 | notify_connect (void *cls, |
189 | const struct GNUNET_PeerIdentity *peer, | 188 | const struct GNUNET_PeerIdentity *peer, |
190 | const struct GNUNET_TRANSPORT_ATS_Information *ats, uint32_t ats_count) | 189 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
190 | uint32_t ats_count) | ||
191 | { | 191 | { |
192 | if (cls == &p1) | 192 | if (cls == &p1) |
193 | { | 193 | { |
@@ -346,12 +346,6 @@ run (void *cls, | |||
346 | die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, | 346 | die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, |
347 | &end_badly, NULL); | 347 | &end_badly, NULL); |
348 | 348 | ||
349 | if (is_multi_protocol) | ||
350 | { | ||
351 | setup_peer (&p1, "test_transport_api_multi_peer1.conf"); | ||
352 | setup_peer (&p2, "test_transport_api_multi_peer2.conf"); | ||
353 | } | ||
354 | |||
355 | if (is_udp) | 349 | if (is_udp) |
356 | { | 350 | { |
357 | setup_peer (&p1, "test_transport_api_udp_peer1.conf"); | 351 | setup_peer (&p1, "test_transport_api_udp_peer1.conf"); |
@@ -567,22 +561,10 @@ main (int argc, char *argv[]) | |||
567 | { | 561 | { |
568 | is_http = GNUNET_YES; | 562 | is_http = GNUNET_YES; |
569 | } | 563 | } |
570 | else if (strstr(argv[0], "multi") != NULL) | ||
571 | { | ||
572 | is_multi_protocol = GNUNET_YES; | ||
573 | } | ||
574 | 564 | ||
575 | ret = check (); | 565 | ret = check (); |
576 | if (is_multi_protocol) | 566 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1"); |
577 | { | 567 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2"); |
578 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-1/"); | ||
579 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-multi-peer-2/"); | ||
580 | } | ||
581 | else | ||
582 | { | ||
583 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-1"); | ||
584 | GNUNET_DISK_directory_remove ("/tmp/test-gnunetd-transport-peer-2"); | ||
585 | } | ||
586 | return ret; | 568 | return ret; |
587 | } | 569 | } |
588 | 570 | ||