Skip to content

Commit

Permalink
mtree: rpc reload without table name reloads all tables
Browse files Browse the repository at this point in the history
- lost feature in rpc which was available in mi command
  • Loading branch information
miconda committed Aug 21, 2018
1 parent ebb1377 commit c216abc
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/modules/mtree/mtree_mod.c
Expand Up @@ -930,7 +930,8 @@ static const char* rpc_mtree_summary_doc[2] = {
void rpc_mtree_reload(rpc_t* rpc, void* c)
{
str tname = {0, 0};
m_tree_t *pt;
m_tree_t *pt = NULL;
int treloaded = 0;

if(db_table.len>0)
{
Expand All @@ -949,8 +950,13 @@ void rpc_mtree_reload(rpc_t* rpc, void* c)

/* read tree name */
if (rpc->scan(c, "S", &tname) != 1) {
rpc->fault(c, 500, "Failed to get table name parameter");
return;
tname.s = 0;
tname.len = 0;
} else {
if(*tname.s=='.') {
tname.s = 0;
tname.len = 0;
}
}

pt = mt_get_first_tree();
Expand All @@ -967,9 +973,13 @@ void rpc_mtree_reload(rpc_t* rpc, void* c)
LM_ERR("cannot re-load mtree from database\n");
goto error;
}
treloaded = 1;
}
pt = pt->next;
}
if(treloaded == 0) {
rpc->fault(c, 500, "No Mtree Name Matching");
}
}

return;
Expand Down

0 comments on commit c216abc

Please sign in to comment.