diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-09-02 20:07:59 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-09-02 20:07:59 +0000 |
commit | eae423bc26419913e447f91a37e48f5ac2f8133f (patch) | |
tree | 2224f4efd5b117ed60596a7102be3cef523e475c /src | |
parent | 586cf79331064d131c90df08e2d51215214a37d2 (diff) | |
download | gnunet-eae423bc26419913e447f91a37e48f5ac2f8133f.tar.gz gnunet-eae423bc26419913e447f91a37e48f5ac2f8133f.zip |
fixing datastore API, improving unindex
Diffstat (limited to 'src')
-rw-r--r-- | src/datastore/gnunet-service-datastore.c | 2 | ||||
-rw-r--r-- | src/fs/fs_unindex.c | 45 | ||||
-rw-r--r-- | src/include/gnunet_datastore_service.h | 4 |
3 files changed, 30 insertions, 21 deletions
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 79dd7a318..87ae427e4 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c | |||
@@ -1016,7 +1016,7 @@ remove_callback (void *cls, | |||
1016 | if (GNUNET_YES == rc->found) | 1016 | if (GNUNET_YES == rc->found) |
1017 | transmit_status (rc->client, GNUNET_OK, NULL); | 1017 | transmit_status (rc->client, GNUNET_OK, NULL); |
1018 | else | 1018 | else |
1019 | transmit_status (rc->client, GNUNET_SYSERR, _("Content not found")); | 1019 | transmit_status (rc->client, GNUNET_NO, _("Content not found")); |
1020 | GNUNET_SERVER_client_drop (rc->client); | 1020 | GNUNET_SERVER_client_drop (rc->client); |
1021 | GNUNET_free (rc); | 1021 | GNUNET_free (rc); |
1022 | return GNUNET_OK; /* last item */ | 1022 | return GNUNET_OK; /* last item */ |
diff --git a/src/fs/fs_unindex.c b/src/fs/fs_unindex.c index 2d16e9aee..fb72c0167 100644 --- a/src/fs/fs_unindex.c +++ b/src/fs/fs_unindex.c | |||
@@ -79,26 +79,6 @@ unindex_reader (void *cls, | |||
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
82 | * Continuation called to notify client about result of the | ||
83 | * datastore removal operation. | ||
84 | * | ||
85 | * @param cls closure | ||
86 | * @param success GNUNET_SYSERR on failure | ||
87 | * @param msg NULL on success, otherwise an error message | ||
88 | */ | ||
89 | static void | ||
90 | process_cont (void *cls, | ||
91 | int success, | ||
92 | const char *msg) | ||
93 | { | ||
94 | struct GNUNET_FS_UnindexContext *uc = cls; | ||
95 | // FIXME: may want to check for errors | ||
96 | // OTHER than content-not-present! | ||
97 | GNUNET_FS_tree_encoder_next (uc->tc); | ||
98 | } | ||
99 | |||
100 | |||
101 | /** | ||
102 | * Function called asking for the current (encoded) | 82 | * Function called asking for the current (encoded) |
103 | * block to be processed. After processing the | 83 | * block to be processed. After processing the |
104 | * client should either call "GNUNET_FS_tree_encode_next" | 84 | * client should either call "GNUNET_FS_tree_encode_next" |
@@ -227,6 +207,31 @@ signal_unindex_error (struct GNUNET_FS_UnindexContext *uc, | |||
227 | 207 | ||
228 | 208 | ||
229 | /** | 209 | /** |
210 | * Continuation called to notify client about result of the | ||
211 | * datastore removal operation. | ||
212 | * | ||
213 | * @param cls closure | ||
214 | * @param success GNUNET_SYSERR on failure | ||
215 | * @param msg NULL on success, otherwise an error message | ||
216 | */ | ||
217 | static void | ||
218 | process_cont (void *cls, | ||
219 | int success, | ||
220 | const char *msg) | ||
221 | { | ||
222 | struct GNUNET_FS_UnindexContext *uc = cls; | ||
223 | if (success == GNUNET_SYSERR) | ||
224 | { | ||
225 | signal_unindex_error (uc, | ||
226 | emsg); | ||
227 | return; | ||
228 | } | ||
229 | |||
230 | GNUNET_FS_tree_encoder_next (uc->tc); | ||
231 | } | ||
232 | |||
233 | |||
234 | /** | ||
230 | * Function called when the tree encoder has | 235 | * Function called when the tree encoder has |
231 | * processed all blocks. Clean up. | 236 | * processed all blocks. Clean up. |
232 | * | 237 | * |
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index acd9af1de..be4931811 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -254,6 +254,10 @@ GNUNET_DATASTORE_get_random (struct GNUNET_DATASTORE_Handle *h, | |||
254 | 254 | ||
255 | /** | 255 | /** |
256 | * Explicitly remove some content from the database. | 256 | * Explicitly remove some content from the database. |
257 | * The "cont"inuation will be called with status | ||
258 | * "GNUNET_OK" if content was removed, "GNUNET_NO" | ||
259 | * if no matching entry was found and "GNUNET_SYSERR" | ||
260 | * on all other types of errors. | ||
257 | * | 261 | * |
258 | * @param h handle to the datastore | 262 | * @param h handle to the datastore |
259 | * @param key key for the value | 263 | * @param key key for the value |