aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_template.c
diff options
context:
space:
mode:
authorDavid Barksdale <amatus@amat.us>2017-02-20 13:08:08 -0600
committerDavid Barksdale <amatus@amat.us>2017-02-20 13:11:19 -0600
commitfe4f6e8cedfa8d0a57b0247727fc4849d38c2f3a (patch)
treecbcbc99a93ec8f466426190a340cc46f54d2641e /src/datastore/plugin_datastore_template.c
parentf553963d649374a75cc5a6e57df39d83565eb913 (diff)
downloadgnunet-fe4f6e8cedfa8d0a57b0247727fc4849d38c2f3a.tar.gz
gnunet-fe4f6e8cedfa8d0a57b0247727fc4849d38c2f3a.zip
Restrict update to positive priority deltas
This is only ever called with positive values and the mysql and postgres plugins were not handling negative values correctly anyway.
Diffstat (limited to 'src/datastore/plugin_datastore_template.c')
-rw-r--r--src/datastore/plugin_datastore_template.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/datastore/plugin_datastore_template.c b/src/datastore/plugin_datastore_template.c
index fdd4fb157..a1e03e8ee 100644
--- a/src/datastore/plugin_datastore_template.c
+++ b/src/datastore/plugin_datastore_template.c
@@ -164,9 +164,7 @@ template_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
164 * @param cls our "struct Plugin*" 164 * @param cls our "struct Plugin*"
165 * @param uid unique identifier of the datum 165 * @param uid unique identifier of the datum
166 * @param delta by how much should the priority 166 * @param delta by how much should the priority
167 * change? If priority + delta < 0 the 167 * change?
168 * priority should be set to 0 (never go
169 * negative).
170 * @param expire new expiration time should be the 168 * @param expire new expiration time should be the
171 * MAX of any existing expiration time and 169 * MAX of any existing expiration time and
172 * this value 170 * this value
@@ -174,7 +172,7 @@ template_plugin_get_expiration (void *cls, PluginDatumProcessor proc,
174 * @param cons_cls continuation closure 172 * @param cons_cls continuation closure
175 */ 173 */
176static void 174static void
177template_plugin_update (void *cls, uint64_t uid, int delta, 175template_plugin_update (void *cls, uint64_t uid, uint32_t delta,
178 struct GNUNET_TIME_Absolute expire, 176 struct GNUNET_TIME_Absolute expire,
179 PluginUpdateCont cont, void *cont_cls) 177 PluginUpdateCont cont, void *cont_cls)
180{ 178{