Skip to content

Commit

Permalink
Merge pull request #755 from kelchy/master
Browse files Browse the repository at this point in the history
permissions: fixed rpc array
  • Loading branch information
miconda committed Aug 22, 2016
2 parents cfb806e + 20a4f7e commit 4344a7f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions modules/permissions/hash.c
Expand Up @@ -612,15 +612,15 @@ int addr_hash_table_rpc_print(struct addr_list** table, rpc_t* rpc, void* c)
struct addr_list *np;


if (rpc->add(c, "{", &th) < 0)
{
rpc->fault(c, 500, "Internal error creating rpc");
return -1;
}

for (i = 0; i < PERM_HASH_SIZE; i++) {
np = table[i];
while (np) {
if (rpc->add(c, "{", &th) < 0)
{
rpc->fault(c, 500, "Internal error creating rpc");
return -1;
}

if(rpc->struct_add(th, "dd{",
"table", i,
"group", np->grp,
Expand Down Expand Up @@ -847,13 +847,13 @@ int subnet_table_rpc_print(struct subnet* table, rpc_t* rpc, void* c)

count = table[PERM_MAX_SUBNETS].grp;

if (rpc->add(c, "{", &th) < 0)
{
rpc->fault(c, 500, "Internal error creating rpc");
return -1;
}

for (i = 0; i < count; i++) {
if (rpc->add(c, "{", &th) < 0)
{
rpc->fault(c, 500, "Internal error creating rpc");
return -1;
}

if(rpc->struct_add(th, "dd{",
"id", i,
"group", table[i].grp,
Expand Down
4 changes: 2 additions & 2 deletions modules/permissions/permissions.c
Expand Up @@ -1016,8 +1016,8 @@ rpc_export_t permissions_rpc[] = {
{"permissions.trustedReload", rpc_trusted_reload, rpc_trusted_reload_doc, 0},
{"permissions.addressReload", rpc_address_reload, rpc_address_reload_doc, 0},
{"permissions.trustedDump", rpc_trusted_dump, rpc_trusted_dump_doc, 0},
{"permissions.addressDump", rpc_address_dump, rpc_address_dump_doc, 0},
{"permissions.subnetDump", rpc_subnet_dump, rpc_subnet_dump_doc, 0},
{"permissions.addressDump", rpc_address_dump, rpc_address_dump_doc, RET_ARRAY},
{"permissions.subnetDump", rpc_subnet_dump, rpc_subnet_dump_doc, RET_ARRAY},
{"permissions.domainDump", rpc_domain_name_dump, rpc_domain_name_dump_doc, 0},
{"permissions.testUri", rpc_test_uri, rpc_test_uri_doc, 0},
{0, 0, 0, 0}
Expand Down

0 comments on commit 4344a7f

Please sign in to comment.