aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/plugin_datastore_mysql.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_mysql.c
parentf553963d649374a75cc5a6e57df39d83565eb913 (diff)
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_mysql.c')
-rw-r--r--src/datastore/plugin_datastore_mysql.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c
index d76b4ccb47..1067064aa1 100644
--- a/src/datastore/plugin_datastore_mysql.c
+++ b/src/datastore/plugin_datastore_mysql.c
@@ -395,9 +395,7 @@ mysql_plugin_put (void *cls,
* @param cls our "struct Plugin*"
* @param uid unique identifier of the datum
* @param delta by how much should the priority
- * change? If priority + delta < 0 the
- * priority should be set to 0 (never go
- * negative).
+ * change?
* @param expire new expiration time should be the
* MAX of any existing expiration time and
* this value
@@ -407,13 +405,12 @@ mysql_plugin_put (void *cls,
static void
mysql_plugin_update (void *cls,
uint64_t uid,
- int delta,
+ uint32_t delta,
struct GNUNET_TIME_Absolute expire,
PluginUpdateCont cont,
void *cont_cls)
{
struct Plugin *plugin = cls;
- uint32_t idelta = (uint32_t) delta;
uint64_t lexpire = expire.abs_value_us;
int ret;
@@ -424,7 +421,7 @@ mysql_plugin_update (void *cls,
GNUNET_STRINGS_absolute_time_to_string (expire));
struct GNUNET_MY_QueryParam params_update[] = {
- GNUNET_MY_query_param_uint32 (&idelta),
+ GNUNET_MY_query_param_uint32 (&delta),
GNUNET_MY_query_param_uint64 (&lexpire),
GNUNET_MY_query_param_uint64 (&lexpire),
GNUNET_MY_query_param_uint64 (&uid),