aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/gnunet-service-datastore.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/datastore/gnunet-service-datastore.c')
-rw-r--r--src/datastore/gnunet-service-datastore.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c
index 8a896a7fb..2f505891c 100644
--- a/src/datastore/gnunet-service-datastore.c
+++ b/src/datastore/gnunet-service-datastore.c
@@ -1255,11 +1255,43 @@ handle_get_random (void *cls,
1255 GNUNET_NO); 1255 GNUNET_NO);
1256 GNUNET_SERVER_client_keep (client); 1256 GNUNET_SERVER_client_keep (client);
1257 plugin->api->iter_migration_order (plugin->api->cls, 1257 plugin->api->iter_migration_order (plugin->api->cls,
1258 0, 1258 GNUNET_BLOCK_TYPE_ANY,
1259 &transmit_item, 1259 &transmit_item,
1260 client); 1260 client);
1261} 1261}
1262 1262
1263/**
1264 * Handle GET_ZERO_ANONYMITY-message.
1265 *
1266 * @param cls closure
1267 * @param client identification of the client
1268 * @param message the actual message
1269 */
1270static void
1271handle_get_zero_anonymity (void *cls,
1272 struct GNUNET_SERVER_Client *client,
1273 const struct GNUNET_MessageHeader *message)
1274{
1275 const struct GetZeroAnonymityMessage * msg = (const struct GetZeroAnonymityMessage*) message;
1276 enum GNUNET_BLOCK_Type type;
1277
1278 type = (enum GNUNET_BLOCK_Type) ntohl (msg->type);
1279#if DEBUG_DATASTORE
1280 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1281 "Processing `%s' request\n",
1282 "GET_ZERO_ANONYMITY");
1283#endif
1284 GNUNET_STATISTICS_update (stats,
1285 gettext_noop ("# GET ZERO ANONYMITY requests received"),
1286 1,
1287 GNUNET_NO);
1288 GNUNET_SERVER_client_keep (client);
1289 plugin->api->iter_zero_anonymity (plugin->api->cls,
1290 type,
1291 &transmit_item,
1292 client);
1293}
1294
1263 1295
1264/** 1296/**
1265 * Context for the 'remove_callback'. 1297 * Context for the 'remove_callback'.
@@ -1373,7 +1405,7 @@ handle_remove (void *cls,
1373 plugin->api->get (plugin->api->cls, 1405 plugin->api->get (plugin->api->cls,
1374 &dm->key, 1406 &dm->key,
1375 &vhash, 1407 &vhash,
1376 ntohl(dm->type), 1408 (enum GNUNET_BLOCK_Type) ntohl(dm->type),
1377 &remove_callback, 1409 &remove_callback,
1378 rc); 1410 rc);
1379} 1411}
@@ -1675,6 +1707,8 @@ run (void *cls,
1675 {&handle_get, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET, 0 }, 1707 {&handle_get, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET, 0 },
1676 {&handle_get_random, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM, 1708 {&handle_get_random, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET_RANDOM,
1677 sizeof(struct GNUNET_MessageHeader) }, 1709 sizeof(struct GNUNET_MessageHeader) },
1710 {&handle_get_zero_anonymity, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_GET_ZERO_ANONYMITY,
1711 sizeof(struct GetZeroAnonymityMessage) },
1678 {&handle_remove, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE, 0 }, 1712 {&handle_remove, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_REMOVE, 0 },
1679 {&handle_drop, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_DROP, 1713 {&handle_drop, NULL, GNUNET_MESSAGE_TYPE_DATASTORE_DROP,
1680 sizeof(struct GNUNET_MessageHeader) }, 1714 sizeof(struct GNUNET_MessageHeader) },