add: transfer missing properties in discovery
fix: save \0 in lmdb
This commit is contained in:
parent
d679d99a92
commit
fa6ceb2bf4
2 changed files with 4 additions and 1 deletions
|
@ -95,6 +95,9 @@ discovery_handle_discover(int fd, controller *cntrlr)
|
||||||
binn *map = binn_map();
|
binn *map = binn_map();
|
||||||
|
|
||||||
binn_map_set_blob(map, DISCOVERY_MAPPING_ID, &cntrlr->id, sizeof(uuid_t));
|
binn_map_set_blob(map, DISCOVERY_MAPPING_ID, &cntrlr->id, sizeof(uuid_t));
|
||||||
|
binn_map_set_str(map, DISCOVERY_MAPPING_NAME, cntrlr->name);
|
||||||
|
binn_map_set_uint32(map, DISCOVERY_MAPPING_COMMAND_PORT, cntrlr->command_port);
|
||||||
|
binn_map_set_uint8(map, DISCOVERY_MAPPING_RELAY_COUNT, cntrlr->relay_count);
|
||||||
|
|
||||||
void *payload = binn_ptr(map);
|
void *payload = binn_ptr(map);
|
||||||
size_t payload_size = binn_size(map);
|
size_t payload_size = binn_size(map);
|
||||||
|
|
|
@ -55,7 +55,7 @@ controller_save(controller *cntrlr, MDB_env *mdb_env)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
value.mv_size = sizeof(char) * strlen(cntrlr->name);
|
value.mv_size = sizeof(char) * (strlen(cntrlr->name) + 1);
|
||||||
value.mv_data = cntrlr->name;
|
value.mv_data = cntrlr->name;
|
||||||
if(controller_save_single(mdb_txn, mdb_dbi, KEY_META_NAME, value))
|
if(controller_save_single(mdb_txn, mdb_dbi, KEY_META_NAME, value))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue