Skip to content

Commit

Permalink
async: return error if trying to execute for faked message
Browse files Browse the repository at this point in the history
- GH #1727
  • Loading branch information
miconda committed Nov 19, 2018
1 parent ab72c5e commit 8b71c46
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/modules/async/async_mod.c
Expand Up @@ -28,6 +28,7 @@
#include "../../core/sr_module.h"
#include "../../core/dprint.h"
#include "../../core/ut.h"
#include "../../core/fmsg.h"
#include "../../core/pvar.h"
#include "../../core/timer_proc.h"
#include "../../core/route_struct.h"
Expand Down Expand Up @@ -153,6 +154,11 @@ static int w_async_sleep(sip_msg_t *msg, char *sec, char *str2)
if(msg == NULL)
return -1;

if(faked_msg_match(msg)) {
LM_ERR("invalid usage for faked message\n");
return -1;
}

if(async_workers <= 0) {
LM_ERR("no async mod timer workers (modparam missing?)\n");
return -1;
Expand Down Expand Up @@ -210,6 +216,11 @@ int ki_async_route(sip_msg_t *msg, str *rn, int s)
int ri;
sr_kemi_eng_t *keng = NULL;

if(faked_msg_match(msg)) {
LM_ERR("invalid usage for faked message\n");
return -1;
}

keng = sr_kemi_eng_get();
if(keng == NULL) {
ri = route_lookup(&main_rt, rn->s);
Expand Down Expand Up @@ -285,6 +296,11 @@ int ki_async_task_route(sip_msg_t *msg, str *rn)
int ri;
sr_kemi_eng_t *keng = NULL;

if(faked_msg_match(msg)) {
LM_ERR("invalid usage for faked message\n");
return -1;
}

keng = sr_kemi_eng_get();
if(keng == NULL) {
ri = route_lookup(&main_rt, rn->s);
Expand Down

0 comments on commit 8b71c46

Please sign in to comment.