diff options
Diffstat (limited to 'src/transport/test_plugin_transport_http.c')
-rw-r--r-- | src/transport/test_plugin_transport_http.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/transport/test_plugin_transport_http.c b/src/transport/test_plugin_transport_http.c index 3c127a950..4ab52cf58 100644 --- a/src/transport/test_plugin_transport_http.c +++ b/src/transport/test_plugin_transport_http.c | |||
@@ -392,7 +392,6 @@ static GNUNET_SCHEDULER_TaskIdentifier http_task_send; | |||
392 | static void | 392 | static void |
393 | shutdown_clean () | 393 | shutdown_clean () |
394 | { | 394 | { |
395 | struct Plugin_Address * cur; | ||
396 | struct Plugin_Address * tmp; | 395 | struct Plugin_Address * tmp; |
397 | 396 | ||
398 | /* Evaluate results */ | 397 | /* Evaluate results */ |
@@ -432,7 +431,6 @@ shutdown_clean () | |||
432 | /* cleaning addresses */ | 431 | /* cleaning addresses */ |
433 | while (addr_head != NULL) | 432 | while (addr_head != NULL) |
434 | { | 433 | { |
435 | cur = addr_head; | ||
436 | tmp = addr_head->next; | 434 | tmp = addr_head->next; |
437 | GNUNET_free (addr_head->addr); | 435 | GNUNET_free (addr_head->addr); |
438 | GNUNET_free (addr_head); | 436 | GNUNET_free (addr_head); |
@@ -481,9 +479,6 @@ static void task_send_cont (void *cls, | |||
481 | const struct GNUNET_PeerIdentity * target, | 479 | const struct GNUNET_PeerIdentity * target, |
482 | int result) | 480 | int result) |
483 | { | 481 | { |
484 | struct Plugin_Address * tmp_addr; | ||
485 | tmp_addr = addr_head; | ||
486 | |||
487 | if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR)) | 482 | if ((cls == &fail_msg_transmited_bigger_max_size) && (result == GNUNET_SYSERR)) |
488 | { | 483 | { |
489 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n"); | 484 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Message bigger max msg size was not sent!\n"); |
@@ -1195,13 +1190,13 @@ run (void *cls, | |||
1195 | 1190 | ||
1196 | /* assertions before start */ | 1191 | /* assertions before start */ |
1197 | GNUNET_assert ((port > 0) && (port <= 65535)); | 1192 | GNUNET_assert ((port > 0) && (port <= 65535)); |
1198 | GNUNET_assert(&my_public_key != NULL); | ||
1199 | GNUNET_assert(&my_identity.hashPubKey != NULL); | ||
1200 | 1193 | ||
1201 | /* load plugins... */ | 1194 | /* load plugins... */ |
1202 | setup_plugin_environment (); | 1195 | setup_plugin_environment (); |
1203 | GNUNET_asprintf (&libname, "libgnunet_plugin_transport_http"); | 1196 | GNUNET_asprintf (&libname, "libgnunet_plugin_transport_http"); |
1204 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Loading HTTP transport plugin `%s'\n"),libname); | 1197 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1198 | _("Loading HTTP transport plugin `%s'\n"), | ||
1199 | libname); | ||
1205 | api = GNUNET_PLUGIN_load (libname, &env); | 1200 | api = GNUNET_PLUGIN_load (libname, &env); |
1206 | GNUNET_free (libname); | 1201 | GNUNET_free (libname); |
1207 | if (api == NULL) | 1202 | if (api == NULL) |
@@ -1217,14 +1212,17 @@ run (void *cls, | |||
1217 | 1212 | ||
1218 | /* testing plugin functionality */ | 1213 | /* testing plugin functionality */ |
1219 | GNUNET_assert (0!=fail_notify_address_count); | 1214 | GNUNET_assert (0!=fail_notify_address_count); |
1220 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transport plugin returned %u addresses to connect to\n", fail_notify_address_count); | 1215 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1216 | "Transport plugin returned %u addresses to connect to\n", | ||
1217 | fail_notify_address_count); | ||
1221 | 1218 | ||
1222 | /* testing pretty printer with all addresses obtained from the plugin*/ | 1219 | /* testing pretty printer with all addresses obtained from the plugin*/ |
1223 | cur = addr_head; | 1220 | cur = addr_head; |
1224 | while (cur != NULL) | 1221 | while (cur != NULL) |
1225 | { | 1222 | { |
1226 | 1223 | api->address_pretty_printer (api->cls, "http", | |
1227 | api->address_pretty_printer (api->cls, "http",cur->addr,cur->addrlen, GNUNET_NO,TEST_TIMEOUT, &pretty_printer_cb,NULL); | 1224 | cur->addr,cur->addrlen, GNUNET_NO,TEST_TIMEOUT, |
1225 | &pretty_printer_cb, NULL); | ||
1228 | addr_str = api->address_to_string (api->cls, cur->addr, cur->addrlen); | 1226 | addr_str = api->address_to_string (api->cls, cur->addr, cur->addrlen); |
1229 | suggest_res = api->check_address (api->cls, cur->addr, cur->addrlen); | 1227 | suggest_res = api->check_address (api->cls, cur->addr, cur->addrlen); |
1230 | 1228 | ||
@@ -1337,7 +1335,8 @@ main (int argc, char *const *argv) | |||
1337 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; | 1335 | "testcase", options, &run, NULL)) ? GNUNET_NO : GNUNET_YES; |
1338 | 1336 | ||
1339 | GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin_http"); | 1337 | GNUNET_DISK_directory_remove ("/tmp/test_gnunet_transport_plugin_http"); |
1340 | 1338 | if (ret != GNUNET_OK) | |
1339 | return 1; | ||
1341 | return fail; | 1340 | return fail; |
1342 | } | 1341 | } |
1343 | 1342 | ||