diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-26 12:58:46 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2012-10-26 12:58:46 +0000 |
commit | 82bc20a8bcbfb269da4dd54476382c924497e7ec (patch) | |
tree | 6c64f597dcbecbf53118d6710bc02ec51da4a4b7 | |
parent | 0c1b1c5380cfff0a8e0e3adae4df2ee048a5fe88 (diff) | |
download | gnunet-82bc20a8bcbfb269da4dd54476382c924497e7ec.tar.gz gnunet-82bc20a8bcbfb269da4dd54476382c924497e7ec.zip |
removed GNUNET_TESTBED_operation_cancel
-rw-r--r-- | src/fs/fs_test_lib.c | 4 | ||||
-rw-r--r-- | src/gns/test_gns_dht_three_peers.c | 4 | ||||
-rw-r--r-- | src/include/gnunet_testbed_service.h | 35 | ||||
-rw-r--r-- | src/mesh/gnunet-regex-profiler.c | 8 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed.c | 2 | ||||
-rw-r--r-- | src/testbed/gnunet-testbed-profiler.c | 4 | ||||
-rw-r--r-- | src/testbed/testbed_api_testbed.c | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api_topology.c | 2 |
8 files changed, 30 insertions, 31 deletions
diff --git a/src/fs/fs_test_lib.c b/src/fs/fs_test_lib.c index 334551964..4323bc66d 100644 --- a/src/fs/fs_test_lib.c +++ b/src/fs/fs_test_lib.c | |||
@@ -212,7 +212,7 @@ publish_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
212 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 212 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
213 | "Timeout while trying to publish data\n"); | 213 | "Timeout while trying to publish data\n"); |
214 | if (NULL == po->fs) | 214 | if (NULL == po->fs) |
215 | GNUNET_TESTBED_operation_cancel (po->fs_op); | 215 | GNUNET_TESTBED_operation_done (po->fs_op); |
216 | else | 216 | else |
217 | GNUNET_TESTBED_operation_done (po->fs_op); | 217 | GNUNET_TESTBED_operation_done (po->fs_op); |
218 | GNUNET_FS_publish_stop (po->publish_context); | 218 | GNUNET_FS_publish_stop (po->publish_context); |
@@ -486,7 +486,7 @@ download_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
486 | dop->download_cont_cls, | 486 | dop->download_cont_cls, |
487 | GNUNET_SCHEDULER_REASON_TIMEOUT); | 487 | GNUNET_SCHEDULER_REASON_TIMEOUT); |
488 | if (NULL == dop->fs) | 488 | if (NULL == dop->fs) |
489 | GNUNET_TESTBED_operation_cancel (dop->fs_op); | 489 | GNUNET_TESTBED_operation_done (dop->fs_op); |
490 | else | 490 | else |
491 | GNUNET_TESTBED_operation_done (dop->fs_op); | 491 | GNUNET_TESTBED_operation_done (dop->fs_op); |
492 | GNUNET_FS_uri_destroy (dop->uri); | 492 | GNUNET_FS_uri_destroy (dop->uri); |
diff --git a/src/gns/test_gns_dht_three_peers.c b/src/gns/test_gns_dht_three_peers.c index 7f5012311..a7bad9bba 100644 --- a/src/gns/test_gns_dht_three_peers.c +++ b/src/gns/test_gns_dht_three_peers.c | |||
@@ -107,12 +107,12 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
107 | 107 | ||
108 | if (NULL != get_cfg_ops[c]) | 108 | if (NULL != get_cfg_ops[c]) |
109 | { | 109 | { |
110 | GNUNET_TESTBED_operation_cancel(get_cfg_ops[c]); | 110 | GNUNET_TESTBED_operation_done(get_cfg_ops[c]); |
111 | get_cfg_ops[c] = NULL; | 111 | get_cfg_ops[c] = NULL; |
112 | } | 112 | } |
113 | if (NULL != connect_ops[c]) | 113 | if (NULL != connect_ops[c]) |
114 | { | 114 | { |
115 | GNUNET_TESTBED_operation_cancel(connect_ops[c]); | 115 | GNUNET_TESTBED_operation_done(connect_ops[c]); |
116 | connect_ops[c] = NULL; | 116 | connect_ops[c] = NULL; |
117 | } | 117 | } |
118 | if (NULL != cfg_handles[c]) | 118 | if (NULL != cfg_handles[c]) |
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index f4c02fbad..c2c6812f4 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -1188,26 +1188,25 @@ GNUNET_TESTBED_service_connect (void *op_cls, | |||
1188 | 1188 | ||
1189 | 1189 | ||
1190 | /** | 1190 | /** |
1191 | * Cancel a pending operation. Releases all resources | 1191 | * This function is used to signal that the event information (struct |
1192 | * of the operation and will ensure that no event | 1192 | * GNUNET_TESTBED_EventInformation) from an operation has been fully processed |
1193 | * is generated for the operation. Does NOT guarantee | 1193 | * i.e. if the event callback is ever called for this operation. If the event |
1194 | * that the operation will be fully undone (or that | 1194 | * callback for this operation has not yet been called, calling this function |
1195 | * nothing ever happened). | 1195 | * cancels the operation, frees its resources and ensures the no event is |
1196 | * generated with respect to this operation. Note that however cancelling an | ||
1197 | * operation does NOT guarantee that the operation will be fully undone (or that | ||
1198 | * nothing ever happened). | ||
1196 | * | 1199 | * |
1197 | * @param operation operation to cancel | 1200 | * This function MUST be called for every operation to fully remove the |
1198 | */ | 1201 | * operation from the operation queue. After calling this function, if |
1199 | void | 1202 | * operation is completed and its event information is of type |
1200 | GNUNET_TESTBED_operation_cancel (struct GNUNET_TESTBED_Operation *operation); | 1203 | * GNUNET_TESTBED_ET_OPERATION_FINISHED, the 'op_result' becomes invalid (!). |
1201 | 1204 | ||
1202 | 1205 | * If the operation is generated from GNUNET_TESTBED_service_connect() then | |
1203 | /** | 1206 | * calling this function on such as operation calls the disconnect adapter if |
1204 | * Signal that the information from an operation has been fully | 1207 | * the connect adapter was ever called. |
1205 | * processed. This function MUST be called for each event | ||
1206 | * of type 'operation_finished' to fully remove the operation | ||
1207 | * from the operation queue. After calling this function, the | ||
1208 | * 'op_result' becomes invalid (!). | ||
1209 | * | 1208 | * |
1210 | * @param operation operation to signal completion for | 1209 | * @param operation operation to signal completion or cancellation |
1211 | */ | 1210 | */ |
1212 | void | 1211 | void |
1213 | GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation); | 1212 | GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation); |
diff --git a/src/mesh/gnunet-regex-profiler.c b/src/mesh/gnunet-regex-profiler.c index e6178eac6..622842332 100644 --- a/src/mesh/gnunet-regex-profiler.c +++ b/src/mesh/gnunet-regex-profiler.c | |||
@@ -395,9 +395,9 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
395 | for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++) | 395 | for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++) |
396 | { | 396 | { |
397 | if (NULL != peers[peer_cnt].mesh_op_handle) | 397 | if (NULL != peers[peer_cnt].mesh_op_handle) |
398 | GNUNET_TESTBED_operation_cancel (peers[peer_cnt].mesh_op_handle); | 398 | GNUNET_TESTBED_operation_done (peers[peer_cnt].mesh_op_handle); |
399 | if (NULL != peers[peer_cnt].stats_op_handle) | 399 | if (NULL != peers[peer_cnt].stats_op_handle) |
400 | GNUNET_TESTBED_operation_cancel (peers[peer_cnt].stats_op_handle); | 400 | GNUNET_TESTBED_operation_done (peers[peer_cnt].stats_op_handle); |
401 | } | 401 | } |
402 | for (search_str_cnt = 0; search_str_cnt < num_search_strings; search_str_cnt++) | 402 | for (search_str_cnt = 0; search_str_cnt < num_search_strings; search_str_cnt++) |
403 | { | 403 | { |
@@ -411,14 +411,14 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
411 | if (NULL != reg_handle) | 411 | if (NULL != reg_handle) |
412 | GNUNET_TESTBED_cancel_registration (reg_handle); | 412 | GNUNET_TESTBED_cancel_registration (reg_handle); |
413 | if (NULL != topology_op) | 413 | if (NULL != topology_op) |
414 | GNUNET_TESTBED_operation_cancel (topology_op); | 414 | GNUNET_TESTBED_operation_done (topology_op); |
415 | for (nhost = 0; nhost < num_hosts; nhost++) | 415 | for (nhost = 0; nhost < num_hosts; nhost++) |
416 | if (NULL != hosts[nhost]) | 416 | if (NULL != hosts[nhost]) |
417 | GNUNET_TESTBED_host_destroy (hosts[nhost]); | 417 | GNUNET_TESTBED_host_destroy (hosts[nhost]); |
418 | GNUNET_free_non_null (hosts); | 418 | GNUNET_free_non_null (hosts); |
419 | while (NULL != (dll_op = dll_op_head)) | 419 | while (NULL != (dll_op = dll_op_head)) |
420 | { | 420 | { |
421 | GNUNET_TESTBED_operation_cancel (dll_op->op); | 421 | GNUNET_TESTBED_operation_done (dll_op->op); |
422 | GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op); | 422 | GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op); |
423 | GNUNET_free (dll_op); | 423 | GNUNET_free (dll_op); |
424 | } | 424 | } |
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index 81cf29c5f..1ece6c6bb 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -3672,7 +3672,7 @@ reghost_free_iterator (void *cls, | |||
3672 | cleanup_focc (focc); | 3672 | cleanup_focc (focc); |
3673 | } | 3673 | } |
3674 | if (NULL != rhc->sub_op) | 3674 | if (NULL != rhc->sub_op) |
3675 | GNUNET_TESTBED_operation_cancel (rhc->sub_op); | 3675 | GNUNET_TESTBED_operation_done (rhc->sub_op); |
3676 | if (NULL != rhc->client) | 3676 | if (NULL != rhc->client) |
3677 | GNUNET_SERVER_client_drop (rhc->client); | 3677 | GNUNET_SERVER_client_drop (rhc->client); |
3678 | GNUNET_free (value); | 3678 | GNUNET_free (value); |
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 4168408e9..0d9143a86 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -258,14 +258,14 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
258 | if (NULL != reg_handle) | 258 | if (NULL != reg_handle) |
259 | GNUNET_TESTBED_cancel_registration (reg_handle); | 259 | GNUNET_TESTBED_cancel_registration (reg_handle); |
260 | if (NULL != topology_op) | 260 | if (NULL != topology_op) |
261 | GNUNET_TESTBED_operation_cancel (topology_op); | 261 | GNUNET_TESTBED_operation_done (topology_op); |
262 | for (nhost = 0; nhost < num_hosts; nhost++) | 262 | for (nhost = 0; nhost < num_hosts; nhost++) |
263 | if (NULL != hosts[nhost]) | 263 | if (NULL != hosts[nhost]) |
264 | GNUNET_TESTBED_host_destroy (hosts[nhost]); | 264 | GNUNET_TESTBED_host_destroy (hosts[nhost]); |
265 | GNUNET_free_non_null (hosts); | 265 | GNUNET_free_non_null (hosts); |
266 | while (NULL != (dll_op = dll_op_head)) | 266 | while (NULL != (dll_op = dll_op_head)) |
267 | { | 267 | { |
268 | GNUNET_TESTBED_operation_cancel (dll_op->op); | 268 | GNUNET_TESTBED_operation_done (dll_op->op); |
269 | GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op); | 269 | GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op); |
270 | GNUNET_free (dll_op); | 270 | GNUNET_free (dll_op); |
271 | } | 271 | } |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 02b20d214..96ac22c2b 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -271,7 +271,7 @@ cleanup_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
271 | _("Some operations are still pending. Cancelling them\n")); | 271 | _("Some operations are still pending. Cancelling them\n")); |
272 | while (NULL != (dll_op = rc->dll_op_head)) | 272 | while (NULL != (dll_op = rc->dll_op_head)) |
273 | { | 273 | { |
274 | GNUNET_TESTBED_operation_cancel (dll_op->op); | 274 | GNUNET_TESTBED_operation_done (dll_op->op); |
275 | GNUNET_CONTAINER_DLL_remove (rc->dll_op_head, rc->dll_op_tail, dll_op); | 275 | GNUNET_CONTAINER_DLL_remove (rc->dll_op_head, rc->dll_op_tail, dll_op); |
276 | GNUNET_free (dll_op); | 276 | GNUNET_free (dll_op); |
277 | } | 277 | } |
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c index 84202ec8c..edf0f5d3f 100644 --- a/src/testbed/testbed_api_topology.c +++ b/src/testbed/testbed_api_topology.c | |||
@@ -177,7 +177,7 @@ oprelease_overlay_configure_topology (void *cls) | |||
177 | { | 177 | { |
178 | for (p = 0; p < tc->link_array_size; p++) | 178 | for (p = 0; p < tc->link_array_size; p++) |
179 | if (NULL != tc->link_array[p].op) | 179 | if (NULL != tc->link_array[p].op) |
180 | GNUNET_TESTBED_operation_cancel (tc->link_array[p].op); | 180 | GNUNET_TESTBED_operation_done (tc->link_array[p].op); |
181 | GNUNET_free (tc->link_array); | 181 | GNUNET_free (tc->link_array); |
182 | } | 182 | } |
183 | GNUNET_free (tc); | 183 | GNUNET_free (tc); |