diff options
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 25 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed.h | 10 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_oc.c | 8 | ||||
-rw-r--r-- | src/testbed/testbed.conf.in | 1 |
4 files changed, 28 insertions, 16 deletions
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index f1dc3fab9..70fe1786f 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -74,6 +74,11 @@ struct ForwardedOperationContext *fopcq_tail; | |||
74 | struct OperationQueue *GST_opq_openfds; | 74 | struct OperationQueue *GST_opq_openfds; |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * Timeout for operations which may take some time | ||
78 | */ | ||
79 | const struct GNUNET_TIME_Relative GST_timeout; | ||
80 | |||
81 | /** | ||
77 | * The size of the host list | 82 | * The size of the host list |
78 | */ | 83 | */ |
79 | unsigned int GST_host_list_size; | 84 | unsigned int GST_host_list_size; |
@@ -765,7 +770,7 @@ lcf_proc_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
765 | &lcf_forwarded_operation_reply_relay, | 770 | &lcf_forwarded_operation_reply_relay, |
766 | lcf); | 771 | lcf); |
767 | lcf->fopc->timeout_task = | 772 | lcf->fopc->timeout_task = |
768 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &lcf_forwarded_operation_timeout, | 773 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &lcf_forwarded_operation_timeout, |
769 | lcf); | 774 | lcf); |
770 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, lcf->fopc); | 775 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, lcf->fopc); |
771 | lcf->state = FINISHED; | 776 | lcf->state = FINISHED; |
@@ -1558,7 +1563,7 @@ handle_peer_create (void *cls, struct GNUNET_SERVER_Client *client, | |||
1558 | &msg->header, | 1563 | &msg->header, |
1559 | peer_create_success_cb, fo_ctxt); | 1564 | peer_create_success_cb, fo_ctxt); |
1560 | fo_ctxt->timeout_task = | 1565 | fo_ctxt->timeout_task = |
1561 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &peer_create_forward_timeout, | 1566 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &peer_create_forward_timeout, |
1562 | fo_ctxt); | 1567 | fo_ctxt); |
1563 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fo_ctxt); | 1568 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fo_ctxt); |
1564 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1569 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -1610,7 +1615,7 @@ handle_peer_destroy (void *cls, struct GNUNET_SERVER_Client *client, | |||
1610 | fopc->operation_id, &msg->header, | 1615 | fopc->operation_id, &msg->header, |
1611 | &peer_destroy_success_cb, fopc); | 1616 | &peer_destroy_success_cb, fopc); |
1612 | fopc->timeout_task = | 1617 | fopc->timeout_task = |
1613 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &GST_forwarded_operation_timeout, | 1618 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &GST_forwarded_operation_timeout, |
1614 | fopc); | 1619 | fopc); |
1615 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); | 1620 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); |
1616 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1621 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -1669,7 +1674,7 @@ handle_peer_start (void *cls, struct GNUNET_SERVER_Client *client, | |||
1669 | &GST_forwarded_operation_reply_relay, | 1674 | &GST_forwarded_operation_reply_relay, |
1670 | fopc); | 1675 | fopc); |
1671 | fopc->timeout_task = | 1676 | fopc->timeout_task = |
1672 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &GST_forwarded_operation_timeout, | 1677 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &GST_forwarded_operation_timeout, |
1673 | fopc); | 1678 | fopc); |
1674 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); | 1679 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); |
1675 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1680 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -1739,7 +1744,7 @@ handle_peer_stop (void *cls, struct GNUNET_SERVER_Client *client, | |||
1739 | &GST_forwarded_operation_reply_relay, | 1744 | &GST_forwarded_operation_reply_relay, |
1740 | fopc); | 1745 | fopc); |
1741 | fopc->timeout_task = | 1746 | fopc->timeout_task = |
1742 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &GST_forwarded_operation_timeout, | 1747 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &GST_forwarded_operation_timeout, |
1743 | fopc); | 1748 | fopc); |
1744 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); | 1749 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); |
1745 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1750 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -1815,7 +1820,7 @@ handle_peer_get_config (void *cls, struct GNUNET_SERVER_Client *client, | |||
1815 | &GST_forwarded_operation_reply_relay, | 1820 | &GST_forwarded_operation_reply_relay, |
1816 | fopc); | 1821 | fopc); |
1817 | fopc->timeout_task = | 1822 | fopc->timeout_task = |
1818 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &GST_forwarded_operation_timeout, | 1823 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &GST_forwarded_operation_timeout, |
1819 | fopc); | 1824 | fopc); |
1820 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); | 1825 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); |
1821 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1826 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -2197,8 +2202,14 @@ testbed_run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
2197 | "MAX_OPEN_FDS", &num)); | 2202 | "MAX_OPEN_FDS", &num)); |
2198 | GST_opq_openfds = GNUNET_TESTBED_operation_queue_create_ ((unsigned int) num); | 2203 | GST_opq_openfds = GNUNET_TESTBED_operation_queue_create_ ((unsigned int) num); |
2199 | GNUNET_assert (GNUNET_OK == | 2204 | GNUNET_assert (GNUNET_OK == |
2205 | GNUNET_CONFIGURATION_get_value_time (cfg, "TESTBED", | ||
2206 | "OPERATION_TIMEOUT", | ||
2207 | (struct | ||
2208 | GNUNET_TIME_Relative *) | ||
2209 | &GST_timeout)); | ||
2210 | GNUNET_assert (GNUNET_OK == | ||
2200 | GNUNET_CONFIGURATION_get_value_string (cfg, "testbed", | 2211 | GNUNET_CONFIGURATION_get_value_string (cfg, "testbed", |
2201 | "HOSTNAME", &hostname)); | 2212 | "HOSTNAME", &hostname)); |
2202 | our_config = GNUNET_CONFIGURATION_dup (cfg); | 2213 | our_config = GNUNET_CONFIGURATION_dup (cfg); |
2203 | GNUNET_SERVER_add_handlers (server, message_handlers); | 2214 | GNUNET_SERVER_add_handlers (server, message_handlers); |
2204 | GNUNET_SERVER_disconnect_notify (server, &client_disconnect_cb, NULL); | 2215 | GNUNET_SERVER_disconnect_notify (server, &client_disconnect_cb, NULL); |
diff --git a/src/testbed/gnunet-service-testbed.h b/src/testbed/gnunet-service-testbed.h index ebf3c66f9..1d465318c 100644 --- a/src/testbed/gnunet-service-testbed.h +++ b/src/testbed/gnunet-service-testbed.h | |||
@@ -54,11 +54,6 @@ | |||
54 | */ | 54 | */ |
55 | #define LIST_GROW_STEP 10 | 55 | #define LIST_GROW_STEP 10 |
56 | 56 | ||
57 | /** | ||
58 | * Default timeout for operations which may take some time | ||
59 | */ | ||
60 | #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 15) | ||
61 | |||
62 | 57 | ||
63 | /** | 58 | /** |
64 | * A routing entry | 59 | * A routing entry |
@@ -611,6 +606,11 @@ extern struct Slave **GST_slave_list; | |||
611 | extern struct OperationQueue *GST_opq_openfds; | 606 | extern struct OperationQueue *GST_opq_openfds; |
612 | 607 | ||
613 | /** | 608 | /** |
609 | * Timeout for operations which may take some time | ||
610 | */ | ||
611 | const extern struct GNUNET_TIME_Relative GST_timeout; | ||
612 | |||
613 | /** | ||
614 | * The size of the peer list | 614 | * The size of the peer list |
615 | */ | 615 | */ |
616 | extern unsigned int GST_peer_list_size; | 616 | extern unsigned int GST_peer_list_size; |
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index 9b571e3dd..8bed69f36 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c | |||
@@ -381,7 +381,7 @@ GST_process_next_focc (struct RegisteredHostContext *rhc) | |||
381 | GNUNET_free (focc->orig_msg); | 381 | GNUNET_free (focc->orig_msg); |
382 | focc->orig_msg = NULL; | 382 | focc->orig_msg = NULL; |
383 | fopc->timeout_task = | 383 | fopc->timeout_task = |
384 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &forwarded_overlay_connect_timeout, | 384 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &forwarded_overlay_connect_timeout, |
385 | fopc); | 385 | fopc); |
386 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); | 386 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); |
387 | } | 387 | } |
@@ -1221,7 +1221,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
1221 | &GST_forwarded_operation_reply_relay, | 1221 | &GST_forwarded_operation_reply_relay, |
1222 | fopc); | 1222 | fopc); |
1223 | fopc->timeout_task = | 1223 | fopc->timeout_task = |
1224 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &GST_forwarded_operation_timeout, | 1224 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &GST_forwarded_operation_timeout, |
1225 | fopc); | 1225 | fopc); |
1226 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); | 1226 | GNUNET_CONTAINER_DLL_insert_tail (fopcq_head, fopcq_tail, fopc); |
1227 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1227 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -1264,7 +1264,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
1264 | occ->peer2_controller = peer2_controller; | 1264 | occ->peer2_controller = peer2_controller; |
1265 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task); | 1265 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task); |
1266 | occ->timeout_task = | 1266 | occ->timeout_task = |
1267 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &timeout_overlay_connect, occ); | 1267 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &timeout_overlay_connect, occ); |
1268 | /* Get the identity of the second peer */ | 1268 | /* Get the identity of the second peer */ |
1269 | if (NULL != occ->peer2_controller) | 1269 | if (NULL != occ->peer2_controller) |
1270 | { | 1270 | { |
@@ -1564,7 +1564,7 @@ GST_handle_remote_overlay_connect (void *cls, | |||
1564 | &cache_transport_peer_connect_notify, | 1564 | &cache_transport_peer_connect_notify, |
1565 | rocc); | 1565 | rocc); |
1566 | rocc->timeout_rocc_task_id = | 1566 | rocc->timeout_rocc_task_id = |
1567 | GNUNET_SCHEDULER_add_delayed (TIMEOUT, &timeout_rocc_task, rocc); | 1567 | GNUNET_SCHEDULER_add_delayed (GST_timeout, &timeout_rocc_task, rocc); |
1568 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1568 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1569 | } | 1569 | } |
1570 | 1570 | ||
diff --git a/src/testbed/testbed.conf.in b/src/testbed/testbed.conf.in index ec05c769b..379cd22d1 100644 --- a/src/testbed/testbed.conf.in +++ b/src/testbed/testbed.conf.in | |||
@@ -4,6 +4,7 @@ AUTOSTART = NO | |||
4 | HOSTNAME = localhost | 4 | HOSTNAME = localhost |
5 | HOME = $SERVICEHOME | 5 | HOME = $SERVICEHOME |
6 | BINARY = gnunet-service-testbed | 6 | BINARY = gnunet-service-testbed |
7 | OPERATION_TIMEOUT = 30 s | ||
7 | # Set this to the path where the testbed helper is installed | 8 | # Set this to the path where the testbed helper is installed |
8 | # HELPER_BINARY_PATH = @prefix@/lib/gnunet/libexec/gnunet-helper-testbed | 9 | # HELPER_BINARY_PATH = @prefix@/lib/gnunet/libexec/gnunet-helper-testbed |
9 | ACCEPT_FROM = 127.0.0.1; | 10 | ACCEPT_FROM = 127.0.0.1; |