Skip to content

Commit

Permalink
secfilter: Convert error messages to error responses in secf_rpc_add_…
Browse files Browse the repository at this point in the history
…dst()
  • Loading branch information
oej committed Jan 3, 2022
1 parent b108bd6 commit 7feb386
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/modules/secfilter/secfilter_rpc.c
Expand Up @@ -63,7 +63,7 @@ void secf_rpc_add_dst(rpc_t *rpc, void *ctx)
char *text = NULL;

if(rpc->scan(ctx, "d", &number) < 1) {
rpc->fault(ctx, 0,
rpc->fault(ctx, 500,
"Invalid Parameters. Usage: secfilter.add_dst "
"number\n Example: secfilter.add_dst "
"555123123");
Expand All @@ -73,7 +73,7 @@ void secf_rpc_add_dst(rpc_t *rpc, void *ctx)
data.s = pkg_malloc(data.len * sizeof(char));
if(!data.s) {
PKG_MEM_ERROR;
rpc->rpl_printf(ctx, "Error insert values in the blacklist");
rpc->fault(ctx, 500, "Error insert values in the blacklist");
return;
}
memcpy(data.s, text, data.len);
Expand All @@ -82,7 +82,7 @@ void secf_rpc_add_dst(rpc_t *rpc, void *ctx)
rpc->rpl_printf(ctx,
"Values (%s) inserted into blacklist destinations", data);
} else {
rpc->rpl_printf(ctx, "Error insert values in the blacklist");
rpc->fault(ctx, 500, "Error insert values in the blacklist");
}
lock_release(&secf_data->lock);
if(data.s)
Expand Down

0 comments on commit 7feb386

Please sign in to comment.