Change-Id: I20f0720bbfe5420a4f411d2dbe268d1d3cdd0cc5
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
memset(&data, 0, sizeof(data));
key.data = rkey;
memset(&data, 0, sizeof(data));
key.data = rkey;
- key.size = strlen(rkey);
+ key.size = (uint32_t)strlen(rkey);
data.data = (void*)value;
data.data = (void*)value;
- data.size = strlen(value);
+ data.size = (uint32_t)strlen(value);
if ((ret = database->put(database, NULL, &key, &data, DB_NOOVERWRITE)) == 0)
afb_req_success_f(req, NULL, "db success: insertion %s=%s.", (char*)key.data, (char*)data.data);
if ((ret = database->put(database, NULL, &key, &data, DB_NOOVERWRITE)) == 0)
afb_req_success_f(req, NULL, "db success: insertion %s=%s.", (char*)key.data, (char*)data.data);
memset(&data, 0, sizeof(data));
key.data = rkey;
memset(&data, 0, sizeof(data));
key.data = rkey;
- key.size = strlen(rkey);
+ key.size = (uint32_t)strlen(rkey);
data.data = (void*)value;
data.data = (void*)value;
- data.size = strlen(value);
+ data.size = (uint32_t)strlen(value);
if ((ret = database->put(database, NULL, &key, &data, 0)) == 0)
afb_req_success_f(req, NULL, "db success: update %s=%s.", (char*)key.data, (char*)data.data);
if ((ret = database->put(database, NULL, &key, &data, 0)) == 0)
afb_req_success_f(req, NULL, "db success: update %s=%s.", (char*)key.data, (char*)data.data);
memset(&key, 0, sizeof(key));
key.data = rkey;
memset(&key, 0, sizeof(key));
key.data = rkey;
- key.size = strlen(rkey);
+ key.size = (uint32_t)strlen(rkey);
if ((ret = database->del(database, NULL, &key, 0)) == 0)
afb_req_success_f(req, NULL, "db success: delete %s.", (char *)key.data);
if ((ret = database->del(database, NULL, &key, 0)) == 0)
afb_req_success_f(req, NULL, "db success: delete %s.", (char *)key.data);
void verb_read(struct afb_req req)
{
void verb_read(struct afb_req req)
{
DBT key;
DBT data;
int ret;
DBT key;
DBT data;
int ret;
memset(&value, 0, 4096);
key.data = rkey;
memset(&value, 0, 4096);
key.data = rkey;
- key.size = strlen(rkey);
+ key.size = (uint32_t)strlen(rkey);
data.data = value;
data.ulen = 4096;
data.data = value;
data.ulen = 4096;
}
// ----- Binding's configuration -----
}
// ----- Binding's configuration -----
static const struct afb_auth ll_database_binding_auths[] = {
};
static const struct afb_auth ll_database_binding_auths[] = {
};
static const afb_verb_v2 ll_database_binding_verbs[]= {
REGISTER_VERB(insert, NULL, NULL, AFB_SESSION_NONE_V2),
static const afb_verb_v2 ll_database_binding_verbs[]= {
REGISTER_VERB(insert, NULL, NULL, AFB_SESSION_NONE_V2),