aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-service-fs_cadet_server.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amat.us>2017-03-22 22:17:05 -0500
committerDavid Barksdale <amatus@amat.us>2017-03-22 22:19:13 -0500
commit78ecfccd774a77ae3d7a51e3f5c7c7c86cf7985b (patch)
tree1dc23a2f6d78c8026e69181ac90055929d79bba8 /src/fs/gnunet-service-fs_cadet_server.c
parentaa98f144e6db0da5a0a4cad83fe64a80bbab6692 (diff)
downloadgnunet-78ecfccd774a77ae3d7a51e3f5c7c7c86cf7985b.tar.gz
gnunet-78ecfccd774a77ae3d7a51e3f5c7c7c86cf7985b.zip
[datastore] Return and update replication
This fixes a couple FIXMEs in the datastore code. The replication value is now returned from the datastore and the update function can increase the replication.
Diffstat (limited to 'src/fs/gnunet-service-fs_cadet_server.c')
-rw-r--r--src/fs/gnunet-service-fs_cadet_server.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/fs/gnunet-service-fs_cadet_server.c b/src/fs/gnunet-service-fs_cadet_server.c
index f8619b812..02ebb2ffe 100644
--- a/src/fs/gnunet-service-fs_cadet_server.c
+++ b/src/fs/gnunet-service-fs_cadet_server.c
@@ -219,19 +219,21 @@ continue_writing (void *cls)
219 * @param type type of the content 219 * @param type type of the content
220 * @param priority priority of the content 220 * @param priority priority of the content
221 * @param anonymity anonymity-level for the content 221 * @param anonymity anonymity-level for the content
222 * @param replication replication-level for the content
222 * @param expiration expiration time for the content 223 * @param expiration expiration time for the content
223 * @param uid unique identifier for the datum; 224 * @param uid unique identifier for the datum;
224 * maybe 0 if no unique identifier is available 225 * maybe 0 if no unique identifier is available
225 */ 226 */
226static void 227static void
227handle_datastore_reply (void *cls, 228handle_datastore_reply (void *cls,
228 const struct GNUNET_HashCode *key, 229 const struct GNUNET_HashCode *key,
229 size_t size, 230 size_t size,
230 const void *data, 231 const void *data,
231 enum GNUNET_BLOCK_Type type, 232 enum GNUNET_BLOCK_Type type,
232 uint32_t priority, 233 uint32_t priority,
233 uint32_t anonymity, 234 uint32_t anonymity,
234 struct GNUNET_TIME_Absolute expiration, 235 uint32_t replication,
236 struct GNUNET_TIME_Absolute expiration,
235 uint64_t uid) 237 uint64_t uid)
236{ 238{
237 struct CadetClient *sc = cls; 239 struct CadetClient *sc = cls;
@@ -273,15 +275,16 @@ handle_datastore_reply (void *cls,
273 GNUNET_h2s (key)); 275 GNUNET_h2s (key));
274 if (GNUNET_OK != 276 if (GNUNET_OK !=
275 GNUNET_FS_handle_on_demand_block (key, 277 GNUNET_FS_handle_on_demand_block (key,
276 size, 278 size,
277 data, 279 data,
278 type, 280 type,
279 priority, 281 priority,
280 anonymity, 282 anonymity,
281 expiration, 283 replication,
282 uid, 284 expiration,
283 &handle_datastore_reply, 285 uid,
284 sc)) 286 &handle_datastore_reply,
287 sc))
285 { 288 {
286 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 289 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
287 "On-demand encoding request failed\n"); 290 "On-demand encoding request failed\n");