Skip to content

Commit

Permalink
core: slow timer - warning message if callback function is null
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Nov 5, 2019
1 parent 867294f commit 574b080
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/core/timer.c
Expand Up @@ -1101,7 +1101,19 @@ void slow_timer_main()
#endif
SET_RUNNING_SLOW(tl);
UNLOCK_SLOW_TIMER_LIST();
ret=tl->f(*ticks, tl, tl->data);
if(likely(tl->f)) {
ret=tl->f(*ticks, tl, tl->data);
} else {
ret =0;
#ifdef TIMER_DEBUG
LM_WARN("null timer callback for %p (%s:%u - %s(...))\n",
tl, (tl->add_file)?tl->add_file:"unknown",
tl->add_line,
(tl->add_func)?tl->add_func:"unknown");
#else
LM_WARN("null callback function for %p\n", tl);
#endif
}
/* reset the configuration group handles */
cfg_reset_all();
if (ret==0){
Expand Down

0 comments on commit 574b080

Please sign in to comment.