diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2022-12-08 19:21:52 +0900 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2022-12-08 19:21:52 +0900 |
commit | f26345b68768695391d9a8ae983a27c03b8ce874 (patch) | |
tree | a5f757e745e9b26c00d0efeb1fbae04a791b30b6 /src | |
parent | 2b48c60fde7d6a70cff7a7852f3188e3673c70bd (diff) | |
download | gnunet-f26345b68768695391d9a8ae983a27c03b8ce874.tar.gz gnunet-f26345b68768695391d9a8ae983a27c03b8ce874.zip |
-more fixmes
Diffstat (limited to 'src')
-rw-r--r-- | src/include/gnunet_testing_ng_lib.h | 21 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_barrier_reached.c | 6 | ||||
-rw-r--r-- | src/testing/testing_api_loop.c | 3 |
3 files changed, 19 insertions, 11 deletions
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index 88910f65f..1e2f4b30d 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -99,6 +99,17 @@ struct GNUNET_TESTING_AsyncContext | |||
99 | */ | 99 | */ |
100 | struct GNUNET_TESTING_Command | 100 | struct GNUNET_TESTING_Command |
101 | { | 101 | { |
102 | // FIXME: This should not be here. Looking at the code commands are used | ||
103 | // in arrays. Not lists. | ||
104 | /** | ||
105 | * Pointer to the previous command in the DLL. | ||
106 | */ | ||
107 | struct GNUNET_TESTING_Command *prev; | ||
108 | |||
109 | /** | ||
110 | * Pointer to the next command in the DLL. | ||
111 | */ | ||
112 | struct GNUNET_TESTING_Command *next; | ||
102 | 113 | ||
103 | /** | 114 | /** |
104 | * Closure for all commands with command-specific context information. | 115 | * Closure for all commands with command-specific context information. |
@@ -195,16 +206,6 @@ struct GNUNET_TESTING_Command | |||
195 | struct GNUNET_TIME_Relative default_timeout; | 206 | struct GNUNET_TIME_Relative default_timeout; |
196 | 207 | ||
197 | /** | 208 | /** |
198 | * Pointer to the previous command in the DLL. | ||
199 | */ | ||
200 | struct GNUNET_TESTING_Command *prev; | ||
201 | |||
202 | /** | ||
203 | * Pointer to the next command in the DLL. | ||
204 | */ | ||
205 | struct GNUNET_TESTING_Command *next; | ||
206 | |||
207 | /** | ||
208 | * How often did we try to execute this command? (In case it is a request | 209 | * How often did we try to execute this command? (In case it is a request |
209 | * that is repated.) Note that a command must have some built-in retry | 210 | * that is repated.) Note that a command must have some built-in retry |
210 | * mechanism for this value to be useful. | 211 | * mechanism for this value to be useful. |
diff --git a/src/testing/testing_api_cmd_barrier_reached.c b/src/testing/testing_api_cmd_barrier_reached.c index 43bf86398..c5b0b692e 100644 --- a/src/testing/testing_api_cmd_barrier_reached.c +++ b/src/testing/testing_api_cmd_barrier_reached.c | |||
@@ -50,7 +50,7 @@ struct BarrierReachedState | |||
50 | const char *label; | 50 | const char *label; |
51 | 51 | ||
52 | /** | 52 | /** |
53 | * The name of the barrier this commands wait (if finishing asynchronous) for or/and reaches. | 53 | * The name of the barrier this commands wait (if finishing asynchronous) for or/and reaches. |
54 | */ | 54 | */ |
55 | const char *barrier_name; | 55 | const char *barrier_name; |
56 | 56 | ||
@@ -103,6 +103,10 @@ barrier_reached_run (void *cls, | |||
103 | } | 103 | } |
104 | else if (GNUNET_NO == brs->asynchronous_finish) | 104 | else if (GNUNET_NO == brs->asynchronous_finish) |
105 | { | 105 | { |
106 | /** FIXME: This is already fishy as commands in is are an array | ||
107 | * It is unclear how this does not end up with a DLL issue. | ||
108 | * We should create a dedicated struct to hold this list. | ||
109 | */ | ||
106 | cmd = GNUNET_TESTING_interpreter_get_current_command (is); | 110 | cmd = GNUNET_TESTING_interpreter_get_current_command (is); |
107 | GNUNET_CONTAINER_DLL_insert (barrier->cmds_head, | 111 | GNUNET_CONTAINER_DLL_insert (barrier->cmds_head, |
108 | barrier->cmds_tail, | 112 | barrier->cmds_tail, |
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c index 01af7da2a..f19654029 100644 --- a/src/testing/testing_api_loop.c +++ b/src/testing/testing_api_loop.c | |||
@@ -686,6 +686,9 @@ GNUNET_TESTING_finish_attached_cmds (struct GNUNET_TESTING_Interpreter *is, | |||
686 | GNUNET_CONTAINER_DLL_remove (barrier->cmds_head, | 686 | GNUNET_CONTAINER_DLL_remove (barrier->cmds_head, |
687 | barrier->cmds_tail, | 687 | barrier->cmds_tail, |
688 | pos); | 688 | pos); |
689 | // FIXME: DANGER DANGER! "pos" is a pointer to the array(!) element in an | ||
690 | // IS. This WILL crash and burn | ||
691 | GNUNET_break (0); | ||
689 | GNUNET_free (pos); | 692 | GNUNET_free (pos); |
690 | } | 693 | } |
691 | free_barrier_node_cb_cls = GNUNET_new (struct FreeBarrierNodeCbCls); | 694 | free_barrier_node_cb_cls = GNUNET_new (struct FreeBarrierNodeCbCls); |