aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_template.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/datastore/plugin_datastore_template.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/datastore/plugin_datastore_template.c')
-rw-r--r--src/datastore/plugin_datastore_template.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/datastore/plugin_datastore_template.c b/src/datastore/plugin_datastore_template.c
index 187221798..8e44f020d 100644
--- a/src/datastore/plugin_datastore_template.c
+++ b/src/datastore/plugin_datastore_template.c
@@ -151,19 +151,17 @@ template_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
151 151
152 152
153/** 153/**
154 * Update the priority for a particular key in the datastore. If 154 * Update the priority, replication and expiration for a particular
155 * the expiration time in value is different than the time found in 155 * unique ID in the datastore. If the expiration time in value is
156 * the datastore, the higher value should be kept. For the 156 * different than the time found in the datastore, the higher value
157 * anonymity level, the lower value is to be used. The specified 157 * should be kept. The specified priority and replication is added
158 * priority should be added to the existing priority, ignoring the 158 * to the existing value.
159 * priority in value.
160 *
161 * Note that it is possible for multiple values to match this put.
162 * In that case, all of the respective values are updated.
163 * 159 *
164 * @param cls our "struct Plugin*" 160 * @param cls our "struct Plugin*"
165 * @param uid unique identifier of the datum 161 * @param uid unique identifier of the datum
166 * @param delta by how much should the priority 162 * @param priority by how much should the priority
163 * change?
164 * @param replication by how much should the replication
167 * change? 165 * change?
168 * @param expire new expiration time should be the 166 * @param expire new expiration time should be the
169 * MAX of any existing expiration time and 167 * MAX of any existing expiration time and
@@ -172,9 +170,13 @@ template_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
172 * @param cons_cls continuation closure 170 * @param cons_cls continuation closure
173 */ 171 */
174static void 172static void
175template_plugin_update (void *cls, uint64_t uid, uint32_t delta, 173template_plugin_update (void *cls,
174 uint64_t uid,
175 uint32_t priority,
176 uint32_t replication,
176 struct GNUNET_TIME_Absolute expire, 177 struct GNUNET_TIME_Absolute expire,
177 PluginUpdateCont cont, void *cont_cls) 178 PluginUpdateCont cont,
179 void *cont_cls)
178{ 180{
179 GNUNET_break (0); 181 GNUNET_break (0);
180 cont (cont_cls, GNUNET_SYSERR, "not implemented"); 182 cont (cont_cls, GNUNET_SYSERR, "not implemented");