Skip to content

Commit

Permalink
async: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent 9f24744 commit 1083f1f
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 73 deletions.
31 changes: 17 additions & 14 deletions src/modules/async/async_mod.c
Expand Up @@ -59,7 +59,8 @@ static int fixup_async_route(void **param, int param_no);
static int w_async_task_route(sip_msg_t *msg, char *rt, char *p2);
static int w_async_task_group_route(sip_msg_t *msg, char *rt, char *gr);
static int w_async_task_data(sip_msg_t *msg, char *rt, char *pdata);
static int w_async_task_group_data(sip_msg_t *msg, char *rt, char *gr, char *pdata);
static int w_async_task_group_data(
sip_msg_t *msg, char *rt, char *gr, char *pdata);
static int fixup_async_task_route(void **param, int param_no);

/* tm */
Expand Down Expand Up @@ -121,7 +122,7 @@ struct module_exports exports = {
static int mod_init(void)
{
/* init faked sip msg */
if(faked_msg_init()<0) {
if(faked_msg_init() < 0) {
LM_ERR("failed to iit local sip msg\n");
return -1;
}
Expand All @@ -148,7 +149,8 @@ static int mod_init(void)
return -1;
}
LM_INFO("Enabled async_ms_sleep and async_ms_route functions"
" with resolution of %dms\n", async_ms_timer);
" with resolution of %dms\n",
async_ms_timer);
}

register_basic_timers(async_workers + (async_ms_timer > 0));
Expand All @@ -171,19 +173,19 @@ static int child_init(int rank)

for(i = 0; i < async_workers; i++) {
if(fork_basic_timer(PROC_TIMER, "ASYNC MOD TIMER", 1 /*socks flag*/,
async_timer_exec, NULL, 1 /*sec*/)
async_timer_exec, NULL, 1 /*sec*/)
< 0) {
LM_ERR("failed to register timer routine as process (%d)\n", i);
return -1; /* error */
}
}

if((async_ms_timer > 0) && fork_basic_utimer(PROC_TIMER,
"ASYNC MOD MS TIMER", 1 /*socks flag*/,
async_mstimer_exec, NULL, 1000 * async_ms_timer /*milliseconds*/)
< 0) {
LM_ERR("failed to register millisecond timer as process (%d)\n",
i);
if((async_ms_timer > 0)
&& fork_basic_utimer(PROC_TIMER, "ASYNC MOD MS TIMER",
1 /*socks flag*/, async_mstimer_exec, NULL,
1000 * async_ms_timer /*milliseconds*/)
< 0) {
LM_ERR("failed to register millisecond timer as process (%d)\n", i);
return -1; /* error */
}

Expand Down Expand Up @@ -488,7 +490,7 @@ int ki_async_task_group_route(sip_msg_t *msg, str *rn, str *gn)
*/
int ki_async_task_route(sip_msg_t *msg, str *rn)
{
return ki_async_task_group_route(msg, rn, NULL);
return ki_async_task_group_route(msg, rn, NULL);
}

/**
Expand Down Expand Up @@ -538,7 +540,7 @@ static int fixup_async_task_route(void **param, int param_no)
{
if(!async_task_initialized()) {
LM_ERR("async task framework was not initialized"
" - set async_workers parameter in core\n");
" - set async_workers parameter in core\n");
return -1;
}

Expand Down Expand Up @@ -586,7 +588,7 @@ int ki_async_task_group_data(sip_msg_t *msg, str *rn, str *gn, str *sdata)
*/
int ki_async_task_data(sip_msg_t *msg, str *rn, str *sdata)
{
return ki_async_task_group_data(msg, rn, NULL, sdata);
return ki_async_task_group_data(msg, rn, NULL, sdata);
}


Expand Down Expand Up @@ -616,7 +618,8 @@ static int w_async_task_data(sip_msg_t *msg, char *rt, char *pdata)
/**
*
*/
static int w_async_task_group_data(sip_msg_t *msg, char *rt, char *gr, char *pdata)
static int w_async_task_group_data(
sip_msg_t *msg, char *rt, char *gr, char *pdata)
{
str rn;
str gn;
Expand Down

0 comments on commit 1083f1f

Please sign in to comment.