diff options
author | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2010-11-05 18:21:50 +0000 |
commit | 75a33a1499cf60ea4364c9aa673816629a6c1413 (patch) | |
tree | 0620da4312bb04de4d7b65074fdd3b0c3dd6cc0e /src/transport/test_plugin_transport_https.c | |
parent | 7217c601ad30760872823193d62307e7a335d226 (diff) | |
download | gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.tar.gz gnunet-75a33a1499cf60ea4364c9aa673816629a6c1413.zip |
big scheduler refactoring, expect some issues
Diffstat (limited to 'src/transport/test_plugin_transport_https.c')
-rw-r--r-- | src/transport/test_plugin_transport_https.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c index 192ca764d..0ca13ad5c 100644 --- a/src/transport/test_plugin_transport_https.c +++ b/src/transport/test_plugin_transport_https.c | |||
@@ -231,11 +231,6 @@ static long long unsigned int port; | |||
231 | static char * test_addr; | 231 | static char * test_addr; |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * Our scheduler. | ||
235 | */ | ||
236 | struct GNUNET_SCHEDULER_Handle *sched; | ||
237 | |||
238 | /** | ||
239 | * Our statistics handle. | 234 | * Our statistics handle. |
240 | */ | 235 | */ |
241 | struct GNUNET_STATISTICS_Handle *stats; | 236 | struct GNUNET_STATISTICS_Handle *stats; |
@@ -449,19 +444,19 @@ shutdown_clean () | |||
449 | 444 | ||
450 | if (ti_send != GNUNET_SCHEDULER_NO_TASK) | 445 | if (ti_send != GNUNET_SCHEDULER_NO_TASK) |
451 | { | 446 | { |
452 | GNUNET_SCHEDULER_cancel(sched,ti_send); | 447 | GNUNET_SCHEDULER_cancel(ti_send); |
453 | ti_send = GNUNET_SCHEDULER_NO_TASK; | 448 | ti_send = GNUNET_SCHEDULER_NO_TASK; |
454 | } | 449 | } |
455 | 450 | ||
456 | if (http_task_send != GNUNET_SCHEDULER_NO_TASK) | 451 | if (http_task_send != GNUNET_SCHEDULER_NO_TASK) |
457 | { | 452 | { |
458 | GNUNET_SCHEDULER_cancel(sched,http_task_send); | 453 | GNUNET_SCHEDULER_cancel(http_task_send); |
459 | http_task_send = GNUNET_SCHEDULER_NO_TASK; | 454 | http_task_send = GNUNET_SCHEDULER_NO_TASK; |
460 | } | 455 | } |
461 | 456 | ||
462 | if (ti_timeout != GNUNET_SCHEDULER_NO_TASK) | 457 | if (ti_timeout != GNUNET_SCHEDULER_NO_TASK) |
463 | { | 458 | { |
464 | GNUNET_SCHEDULER_cancel(sched,ti_timeout); | 459 | GNUNET_SCHEDULER_cancel(ti_timeout); |
465 | ti_timeout = GNUNET_SCHEDULER_NO_TASK; | 460 | ti_timeout = GNUNET_SCHEDULER_NO_TASK; |
466 | } | 461 | } |
467 | 462 | ||
@@ -469,7 +464,7 @@ shutdown_clean () | |||
469 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Unloading https plugin\n"); | 464 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Unloading https plugin\n"); |
470 | GNUNET_assert (NULL == GNUNET_PLUGIN_unload ("libgnunet_plugin_transport_https", api)); | 465 | GNUNET_assert (NULL == GNUNET_PLUGIN_unload ("libgnunet_plugin_transport_https", api)); |
471 | 466 | ||
472 | GNUNET_SCHEDULER_shutdown(sched); | 467 | GNUNET_SCHEDULER_shutdown(); |
473 | GNUNET_DISK_directory_remove ("/tmp/test_plugin_transport_http"); | 468 | GNUNET_DISK_directory_remove ("/tmp/test_plugin_transport_http"); |
474 | 469 | ||
475 | struct stat sbuf; | 470 | struct stat sbuf; |
@@ -804,8 +799,7 @@ static size_t send_prepare( struct HTTP_Transfer * result) | |||
804 | gws = GNUNET_NETWORK_fdset_create (); | 799 | gws = GNUNET_NETWORK_fdset_create (); |
805 | GNUNET_NETWORK_fdset_copy_native (grs, &rs, max + 1); | 800 | GNUNET_NETWORK_fdset_copy_native (grs, &rs, max + 1); |
806 | GNUNET_NETWORK_fdset_copy_native (gws, &ws, max + 1); | 801 | GNUNET_NETWORK_fdset_copy_native (gws, &ws, max + 1); |
807 | http_task_send = GNUNET_SCHEDULER_add_select (sched, | 802 | http_task_send = GNUNET_SCHEDULER_add_select (GNUNET_SCHEDULER_PRIORITY_DEFAULT, |
808 | GNUNET_SCHEDULER_PRIORITY_DEFAULT, | ||
809 | GNUNET_SCHEDULER_NO_TASK, | 803 | GNUNET_SCHEDULER_NO_TASK, |
810 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 0), | 804 | GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 0), |
811 | grs, | 805 | grs, |
@@ -933,7 +927,6 @@ static void | |||
933 | setup_plugin_environment () | 927 | setup_plugin_environment () |
934 | { | 928 | { |
935 | env.cfg = cfg; | 929 | env.cfg = cfg; |
936 | env.sched = sched; | ||
937 | env.stats = stats; | 930 | env.stats = stats; |
938 | env.my_identity = &my_identity; | 931 | env.my_identity = &my_identity; |
939 | env.cls = &env; | 932 | env.cls = &env; |
@@ -1149,17 +1142,14 @@ static void run_connection_tests( int phase , void * cls) | |||
1149 | * Runs the test. | 1142 | * Runs the test. |
1150 | * | 1143 | * |
1151 | * @param cls closure | 1144 | * @param cls closure |
1152 | * @param s scheduler to use | ||
1153 | * @param c configuration to use | 1145 | * @param c configuration to use |
1154 | */ | 1146 | */ |
1155 | static void | 1147 | static void |
1156 | run (void *cls, | 1148 | run (void *cls, |
1157 | struct GNUNET_SCHEDULER_Handle *s, | ||
1158 | char *const *args, | 1149 | char *const *args, |
1159 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) | 1150 | const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *c) |
1160 | { | 1151 | { |
1161 | char * libname; | 1152 | char * libname; |
1162 | sched = s; | ||
1163 | cfg = c; | 1153 | cfg = c; |
1164 | char *keyfile; | 1154 | char *keyfile; |
1165 | unsigned long long tneigh; | 1155 | unsigned long long tneigh; |
@@ -1288,7 +1278,7 @@ run (void *cls, | |||
1288 | return; | 1278 | return; |
1289 | } | 1279 | } |
1290 | 1280 | ||
1291 | ti_timeout = GNUNET_SCHEDULER_add_delayed (sched, TEST_TIMEOUT, &task_timeout, NULL); | 1281 | ti_timeout = GNUNET_SCHEDULER_add_delayed (TEST_TIMEOUT, &task_timeout, NULL); |
1292 | 1282 | ||
1293 | /* testing plugin functionality */ | 1283 | /* testing plugin functionality */ |
1294 | GNUNET_assert (0!=fail_notify_address_count); | 1284 | GNUNET_assert (0!=fail_notify_address_count); |