kamailio.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
List overview
Download
sr-dev
October 2014
----- 2025 -----
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
sr-dev@lists.kamailio.org
34 participants
381 discussions
Start a n
N
ew thread
git:master: rad_dict.h: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: a539b5612a1189fa193db8429732cfb5c0183990 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=a539b56…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 16:41:51 2014 -0400 rad_dict.h: logging: convert LOG to LM_* --- rad_dict.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rad_dict.h b/rad_dict.h index fefb856..5354ca9 100644 --- a/rad_dict.h +++ b/rad_dict.h @@ -147,8 +147,8 @@ typedef enum rad_val { continue; \ da = rc_dict_findattr(rh, at[i].n); \ if (da == NULL) { \ - LOG(L_ERR, "ERROR: %s: can't get code for the " \ - "%s attribute\n", fn, at[i].n); \ + LM_ERR("%s: can't get code for %s attr\n", \ + fn, at[i].n); \ return e1; \ } \ at[i].v = da->value; \ @@ -158,8 +158,8 @@ typedef enum rad_val { continue; \ dv = rc_dict_findval(rh, vl[i].n); \ if (dv == NULL) { \ - LOG(L_ERR, "ERROR: %s: can't get code for the " \ - "%s attribute value\n", fn, vl[i].n);\ + LM_ERR("%s: can't get code for %s attr value\n",\ + fn, vl[i].n); \ return e2; \ } \ vl[i].v = dv->value; \
10 years, 3 months
1
0
0
0
git:master: nonsip_hooks.c: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 347dd3c74d82447479928f05340b5fde1029ac2e URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=347dd3c…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 16:38:02 2014 -0400 nonsip_hooks.c: logging: convert LOG to LM_* --- nonsip_hooks.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/nonsip_hooks.c b/nonsip_hooks.c index 490da40..4690f8c 100644 --- a/nonsip_hooks.c +++ b/nonsip_hooks.c @@ -61,7 +61,7 @@ int init_nonsip_hooks() memset(nonsip_hooks, 0, nonsip_max_hooks*sizeof(struct nonsip_hook)); return 0; error: - LOG(L_ERR, "nonsip_hooks: memory allocation failure\n"); + LM_ERR("memory allocation failure\n"); return -1; }
10 years, 3 months
1
0
0
0
git:master: local_timer.c: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 0fe3535561dba78824e973c099aec2444b02601c URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0fe3535…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 16:36:35 2014 -0400 local_timer.c: logging: convert LOG to LM_* --- local_timer.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/local_timer.c b/local_timer.c index 87a85c0..1673e0e 100644 --- a/local_timer.c +++ b/local_timer.c @@ -93,8 +93,7 @@ static inline int _local_timer_dist_tl(struct local_timer* h, { if (likely(delta<H0_ENTRIES)){ if (unlikely(delta==0)){ - LOG(L_WARN, "WARNING: local_timer: add_timeout: 0 expire timer" - " added\n"); + LM_WARN("0 expire timer added\n"); _timer_add_list(&h->timer_lst.expired, tl); }else{ _timer_add_list( &h->timer_lst.h0[tl->expire & H0_MASK], tl); @@ -162,8 +161,7 @@ int local_timer_add(struct local_timer* h, struct timer_ln* tl, ticks_t delta, } tl->initial_timeout=delta; if (unlikely((tl->next!=0) || (tl->prev!=0))){ - LOG(L_CRIT, "BUG: tcp_timer_add: called with linked timer:" - " %p (%p, %p)\n", tl, tl->next, tl->prev); + LM_CRIT("called with linked timer: %p (%p, %p)\n", tl, tl->next, tl->prev); ret=-1; goto error; } @@ -256,7 +254,7 @@ void local_timer_run(struct local_timer* lt, ticks_t saved_ticks) /* protect against time running backwards */ if (unlikely(lt->prev_ticks>=saved_ticks)){ - LOG(L_CRIT, "BUG: local_timer: backwards or still time\n"); + LM_CRIT("backwards or still time\n"); /* try to continue */ lt->prev_ticks=saved_ticks-1; return;
10 years, 3 months
1
0
0
0
git:master: dset.c: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: bac61abf195ba2bfd33584ef2706e7d00227ee96 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=bac61ab…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 16:33:48 2014 -0400 dset.c: logging: convert LOG to LM_* --- dset.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dset.c b/dset.c index 174f1e3..8e7410e 100644 --- a/dset.c +++ b/dset.c @@ -334,7 +334,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path, * of branches, don't try new ones */ if (unlikely(nr_branches == MAX_BRANCHES - 1)) { - LOG(L_ERR, "max nr of branches exceeded\n"); + LM_ERR("max nr of branches exceeded\n"); ser_error = E_TOO_MANY_BRANCHES; return -1; } @@ -350,14 +350,14 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path, } if (unlikely(luri.len > MAX_URI_SIZE - 1)) { - LOG(L_ERR, "too long uri: %.*s\n", luri.len, luri.s); + LM_ERR("too long uri: %.*s\n", luri.len, luri.s); return -1; } /* copy the dst_uri */ if (dst_uri && dst_uri->len && dst_uri->s) { if (unlikely(dst_uri->len > MAX_URI_SIZE - 1)) { - LOG(L_ERR, "too long dst_uri: %.*s\n", dst_uri->len, dst_uri->s); + LM_ERR("too long dst_uri: %.*s\n", dst_uri->len, dst_uri->s); return -1; } memcpy(branches[nr_branches].dst_uri, dst_uri->s, dst_uri->len); @@ -371,7 +371,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path, /* copy the path string */ if (unlikely(path && path->len && path->s)) { if (unlikely(path->len > MAX_PATH_SIZE - 1)) { - LOG(L_ERR, "too long path: %.*s\n", path->len, path->s); + LM_ERR("too long path: %.*s\n", path->len, path->s); return -1; } memcpy(branches[nr_branches].path, path->s, path->len); @@ -394,7 +394,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path, /* copy instance string */ if (unlikely(instance && instance->len && instance->s)) { if (unlikely(instance->len > MAX_INSTANCE_SIZE - 1)) { - LOG(L_ERR, "too long instance: %.*s\n", + LM_ERR("too long instance: %.*s\n", instance->len, instance->s); return -1; } @@ -413,7 +413,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path, /* copy ruid string */ if (unlikely(ruid && ruid->len && ruid->s)) { if (unlikely(ruid->len > MAX_RUID_SIZE - 1)) { - LOG(L_ERR, "too long ruid: %.*s\n", + LM_ERR("too long ruid: %.*s\n", ruid->len, ruid->s); return -1; } @@ -428,7 +428,7 @@ int append_branch(struct sip_msg* msg, str* uri, str* dst_uri, str* path, if (unlikely(location_ua && location_ua->len && location_ua->s)) { if (unlikely(location_ua->len > MAX_UA_SIZE)) { - LOG(L_ERR, "too long location_ua: %.*s\n", + LM_ERR("too long location_ua: %.*s\n", location_ua->len, location_ua->s); return -1; } @@ -492,7 +492,7 @@ char* print_dset(struct sip_msg* msg, int* len) *len += CONTACT_LEN + CRLF_LEN + (cnt - 1) * CONTACT_DELIM_LEN; if (*len + 1 > MAX_REDIRECTION_LEN) { - LOG(L_ERR, "ERROR: redirection buffer length exceed\n"); + LM_ERR("redirection buffer length exceed\n"); goto error; }
10 years, 3 months
1
0
0
0
git:master: test/unit: updates to unit tests 10..19
by Daniel-Constantin Mierla
Module: sip-router Branch: master Commit: 103ba4ab9dad2f59c862cef09a80d52f585e9fcf URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=103ba4a…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: Fri Oct 3 22:25:48 2014 +0200 test/unit: updates to unit tests 10..19 --- test/unit/10.sh | 8 ++++---- test/unit/11.cfg | 14 ++++++-------- test/unit/11.sh | 46 ++++++++++++++++++++++++---------------------- test/unit/12.cfg | 12 ++++++------ test/unit/13.cfg | 24 ++++++++++++++---------- test/unit/13.sh | 13 ++++++------- test/unit/14.cfg | 6 ++++-- test/unit/14.sh | 7 ++----- test/unit/15.sh | 7 ++++--- test/unit/16.sh | 10 +++++----- test/unit/17.sh | 14 ++++++++------ test/unit/18.sh | 6 +++--- test/unit/19.cfg | 3 ++- test/unit/19.sh | 8 ++++---- 14 files changed, 92 insertions(+), 86 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=103…
10 years, 3 months
1
0
0
0
git:master: timer.c: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 1c5f9e094b4ac7f3a7ab7cae0551986769c5bb7a URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1c5f9e0…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 16:26:15 2014 -0400 timer.c: logging: convert LOG to LM_* --- timer.c | 68 ++++++++++++++++++++++++++++---------------------------------- 1 files changed, 31 insertions(+), 37 deletions(-) diff --git a/timer.c b/timer.c index 7a175ad..786db49 100644 --- a/timer.c +++ b/timer.c @@ -235,24 +235,23 @@ int init_timer() timer_lst=shm_malloc(sizeof(struct timer_lists)); #else /* in this case get_ticks won't work! */ - LOG(L_INFO, "WARNING: no shared memory support compiled in" - " get_ticks won't work\n"); + LM_WARN("no shared memory support compiled in get_ticks won't work\n"); ticks=pkg_malloc(sizeof(ticks_t)); timer_lst=pkg_malloc(sizeof(struct timer_lists)); #endif if (ticks==0){ - LOG(L_CRIT, "ERROR: init_timer: out of shared memory (ticks)\n"); + LM_CRIT("out of shared memory (ticks)\n"); ret=E_OUT_OF_MEM; goto error; } if (timer_lst==0){ - LOG(L_CRIT, "ERROR: init_timer: out of shared memory (timer_lst)\n"); + LM_CRIT("out of shared memory (timer_lst)\n"); ret=E_OUT_OF_MEM; goto error; } running_timer=shm_malloc(sizeof(struct timer_ln*)); if (running_timer==0){ - LOG(L_CRIT, "ERROR: init_timer: out of memory (running_timer)\n"); + LM_CRIT("out of memory (running_timer)\n"); ret=E_OUT_OF_MEM; goto error; } @@ -263,8 +262,7 @@ int init_timer() prev_ticks=last_ticks=last_adj_check=*ticks; *running_timer=0; if (gettimeofday(&start_time, 0)<0){ - LOG(L_ERR, "ERROR: init_timer: gettimeofday failed: %s [%d]\n", - strerror(errno), errno); + LM_ERR("gettimeofday failed: %s [%d]\n", strerror(errno), errno); ret=-1; goto error; } @@ -299,7 +297,7 @@ int init_timer() slow_timer_lists=shm_malloc(sizeof(struct timer_head)*SLOW_LISTS_NO); running_timer2=shm_malloc(sizeof(struct timer_ln*)); if ((t_idx==0)||(s_idx==0) || (slow_timer_lists==0) ||(running_timer2==0)){ - LOG(L_ERR, "ERROR: init_timer: out of shared memory (slow)\n"); + LM_ERR("out of shared memory (slow)\n"); ret=E_OUT_OF_MEM; goto error; } @@ -333,8 +331,7 @@ int arm_slow_timer() again: if (sigprocmask(SIG_BLOCK, &slow_timer_sset, 0)==-1){ if (errno==EINTR) goto again; - LOG(L_ERR, "ERROR: arm_slow_timer: sigprocmask failed: %s [%d]}n", - strerror(errno), errno); + LM_ERR("sigprocmask failed: %s [%d]}n", strerror(errno), errno); goto error; } #ifdef __OS_darwin @@ -374,18 +371,16 @@ int arm_timer() it.it_value=it.it_interval; /* install the signal handler */ if (set_sig_h(SIGALRM, sig_timer) == SIG_ERR ){ - LOG(L_CRIT, "ERROR: init_timer: the SIGALRM signal handler cannot" - " be installed: %s [%d]\n", strerror(errno), errno); + LM_CRIT("SIGALRM signal handler cannot be installed: %s [%d]\n", + strerror(errno), errno); return -1; } if (setitimer(ITIMER_REAL, &it, 0) == -1){ - LOG(L_CRIT, "ERROR: init_timer: setitimer failed: %s [%d]\n", - strerror(errno), errno); + LM_CRIT("setitimer failed: %s [%d]\n", strerror(errno), errno); return -1; } if (gettimeofday(&last_time, 0)<0){ - LOG(L_ERR, "ERROR: arm_timer: gettimeofday failed: %s [%d]\n", - strerror(errno), errno); + LM_ERR("gettimeofday failed: %s [%d]\n", strerror(errno), errno); return -1; } /* initialize the config framework */ @@ -426,14 +421,13 @@ inline static void adjust_ticks(void) #endif /* DBG_ser_time */ last_adj_check=*ticks; if (gettimeofday(&crt_time, 0)<0){ - LOG(L_ERR, "ERROR: adjust_ticks: gettimeofday failed: %s [%d]\n", - strerror(errno), errno); + LM_ERR("gettimeofday failed: %s [%d]\n", strerror(errno), errno); return; /* ignore */ } diff_time=(long long)crt_time.tv_sec*1000000+crt_time.tv_usec- ((long long) last_time.tv_sec*1000000+last_time.tv_usec); if (diff_time<0){ - LOG(L_WARN, "WARNING: time changed backwards %ld ms ignoring...\n", + LM_WARN("time changed backwards %ld ms ignoring...\n", (long)(diff_time/1000)); last_time=crt_time; last_ticks=*ticks; @@ -442,7 +436,7 @@ inline static void adjust_ticks(void) diff_time_ticks=(ticks_t)((diff_time*TIMER_TICKS_HZ)/1000000LL); delta=(s_ticks_t)(diff_time_ticks-diff_ticks_raw); if (delta<-1){ - LOG(L_WARN, "WARNING: our timer runs faster then real-time" + LM_WARN("our timer runs faster then real-time" " (%lu ms / %u ticks our time .->" " %lu ms / %u ticks real time)\n", (unsigned long)(diff_ticks_raw*1000L/TIMER_TICKS_HZ), @@ -599,7 +593,7 @@ int timer_add_safe(struct timer_ln* tl, ticks_t delta) } tl->initial_timeout=delta; if ((tl->next!=0) || (tl->prev!=0)){ - LOG(L_CRIT, "BUG: timer_add: called with linked timer: %p (%p, %p)\n", + LM_CRIT("timer_add: called with linked timer: %p (%p, %p)\n", tl, tl->next, tl->prev); ret=-1; goto error; @@ -668,7 +662,7 @@ again: if (IS_IN_TIMER_SLOW()){ /* if somebody tries to shoot himself in the foot, * warn him and ignore the delete */ - LOG(L_CRIT, "BUG: timer handle %p (s) tried to delete" + LM_CRIT("timer handle %p (s) tried to delete" " itself\n", tl); #ifdef TIMER_DEBUG LOG(timerlog, "WARN: -timer_del-: called from %s(%s):%d\n", @@ -738,7 +732,7 @@ again: if (IS_IN_TIMER()){ /* if somebody tries to shoot himself in the foot, * warn him and ignore the delete */ - LOG(L_CRIT, "BUG: timer handle %p tried to delete" + LM_CRIT("timer handle %p tried to delete" " itself\n", tl); #ifdef TIMER_DEBUG LOG(timerlog, "WARN: -timer_del-: called from %s(%s):%d\n", @@ -825,7 +819,7 @@ void timer_allow_del(void) UNSET_RUNNING_SLOW(); }else #endif - LOG(L_CRIT, "BUG: timer_allow_del called outside a timer handle\n"); + LM_CRIT("timer_allow_del called outside a timer handle\n"); } @@ -856,19 +850,19 @@ inline static void timer_list_expire(ticks_t t, struct timer_head* h tl=h->next; #ifdef TIMER_DEBUG /* FIXME: replace w/ EXTRA_DEBUG */ if (tl==0){ - LOG(L_CRIT, "BUG: timer_list_expire: tl=%p, h=%p {%p, %p}\n", + LM_CRIT("timer_list_expire: tl=%p, h=%p {%p, %p}\n", tl, h, h->next, h->prev); abort(); }else if((tl->next==0) || (tl->prev==0)){ - LOG(L_CRIT, "BUG: timer_list_expire: @%d tl=%p " + LM_CRIT("timer_list_expire: @%d tl=%p " "{ %p, %p, %d, %d, %p, %p, %04x, -}," " h=%p {%p, %p}\n", t, tl, tl->next, tl->prev, tl->expire, tl->initial_timeout, tl->data, tl->f, tl->flags, h, h->next, h->prev); - LOG(L_CRIT, "BUG: -timer_list_expire-: cycle %d, first %p," + LM_CRIT("-timer_list_expire-: cycle %d, first %p," "running %p\n", i, first, *running_timer); - LOG(L_CRIT, "BUG: -timer_list_expire-: added %d times" + LM_CRIT("-timer_list_expire-: added %d times" ", last from: %s(%s):%d, deleted %d times" ", last from: %s(%s):%d, init %d times, expired %d \n", tl->add_calls, @@ -944,7 +938,7 @@ static void timer_handler(void) do{ saved_ticks=*ticks; /* protect against time running backwards */ if (prev_ticks>=saved_ticks){ - LOG(L_CRIT, "BUG: timer_handler: backwards or still time\n"); + LM_CRIT("backwards or still time\n"); /* try to continue */ prev_ticks=saved_ticks-1; break; @@ -970,7 +964,7 @@ static void timer_handler(void) if ((slow_idx_t)(*t_idx-*s_idx) < (SLOW_LISTS_NO-1U)) (*t_idx)++; else{ - LOG(L_WARN, "slow timer too slow: overflow (%d - %d = %d)\n", + LM_WARN("slow timer too slow: overflow (%d - %d = %d)\n", *t_idx, *s_idx, *t_idx-*s_idx); /* trying to continue */ } @@ -1031,7 +1025,7 @@ int register_timer(timer_function f, void* param, unsigned int interval) t=shm_malloc(sizeof(struct sr_timer)); if (t==0){ - LOG(L_ERR, "ERROR: register_timer: out of memory\n"); + LM_ERR("out of memory\n"); goto error; } t->id=timer_id++; @@ -1040,7 +1034,7 @@ int register_timer(timer_function f, void* param, unsigned int interval) timer_init(&t->tl, compat_old_handler, t, 0); /* is slow */ if (timer_add(&t->tl, S_TO_TICKS(interval))!=0){ - LOG(L_ERR, "ERROR: register_timer: timer_add failed\n"); + LM_ERR("timer_add failed\n"); return -1; } @@ -1055,7 +1049,7 @@ error: ticks_t get_ticks_raw() { #ifndef SHM_MEM - LOG(L_CRIT, "WARNING: get_ticks: no shared memory support compiled in" + LM_CRIT("no shared memory support compiled in" ", returning 0 (probably wrong)"); return 0; #endif @@ -1068,7 +1062,7 @@ ticks_t get_ticks_raw() ticks_t get_ticks() { #ifndef SHM_MEM - LOG(L_CRIT, "WARNING: get_ticks: no shared memory support compiled in" + LM_CRIT("no shared memory support compiled in" ", returning 0 (probably wrong)"); return 0; #endif @@ -1083,7 +1077,8 @@ ticks_t get_ticks() * This function is intended to be executed in a special separated process * (the "slow" timer) which will run the timer handlers of all the registered * timers not marked as "fast". The ideea is to execute the fast timers in the - * "main" timer process, as accurate as possible and defer the execution of the * timers marked as "slow" to the "slow" timer. + * "main" timer process, as accurate as possible and defer the execution of the + * timers marked as "slow" to the "slow" timer. * Implementation details: * - it waits for a signal and then wakes up and processes * all the lists in slow_timer_lists from [s_idx, t_idx). It will @@ -1113,8 +1108,7 @@ void slow_timer_main() #endif if (n==-1){ if (errno==EINTR) continue; /* some other signal, ignore it */ - LOG(L_ERR, "ERROR: slow_timer_main: sigwaitinfo failed: %s [%d]\n", - strerror(errno), errno); + LM_ERR("sigwaitinfo failed: %s [%d]\n", strerror(errno), errno); sleep(1); /* try to continue */ }
10 years, 3 months
1
0
0
0
git:master: io_wait.c: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 7552e5e2cb115fa60fdf8e9998e293d6501c086e URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=7552e5e…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 16:07:26 2014 -0400 io_wait.c: logging: convert LOG to LM_* --- io_wait.c | 61 +++++++++++++++++++++++++------------------------------------ 1 files changed, 25 insertions(+), 36 deletions(-) diff --git a/io_wait.c b/io_wait.c index 1493283..9a80700 100644 --- a/io_wait.c +++ b/io_wait.c @@ -118,8 +118,8 @@ static int init_sigio(io_wait_h* h, int rsig) n=SIGRTMAX-SIGRTMIN; }else{ if ((rsig < SIGRTMIN) || (rsig >SIGRTMAX)){ - LOG(L_CRIT, "ERROR: init_sigio: real time signal %d out of" - " range [%d, %d]\n", rsig, SIGRTMIN, SIGRTMAX); + LM_CRIT("real time signal %d out of range [%d, %d]\n", + rsig, SIGRTMIN, SIGRTMAX); goto error; } start_sig=rsig; @@ -132,8 +132,7 @@ retry1: /* get current block mask */ if (sigprocmask(SIG_BLOCK, &h->sset, &oldset )==-1){ if (errno==EINTR) goto retry1; - LOG(L_ERR, "ERROR: init_sigio: 1st sigprocmask failed: %s [%d]\n", - strerror(errno), errno); + LM_ERR("1st sigprocmask failed: %s [%d]\n", strerror(errno), errno); /* try to continue */ } @@ -149,8 +148,7 @@ retry1: } if (h->signo==0){ - LOG(L_CRIT, "ERROR: init_sigio: %s\n", - rsig?"could not assign requested real-time signal": + LM_CRIT("%s\n", rsig?"could not assign requested real-time signal": "out of real-time signals"); goto error; } @@ -158,19 +156,19 @@ retry1: DBG("init_sigio: trying signal %d... \n", h->signo); if (sigaddset(&h->sset, h->signo)==-1){ - LOG(L_ERR, "ERROR: init_sigio: sigaddset failed for %d: %s [%d]\n", + LM_ERR("sigaddset failed for %d: %s [%d]\n", h->signo, strerror(errno), errno); goto error; } if (sigaddset(&h->sset, SIGIO)==-1){ - LOG(L_ERR, "ERROR: init_sigio: sigaddset failed for %d: %s [%d]\n", + LM_ERR("sigaddset failed for %d: %s [%d]\n", SIGIO, strerror(errno), errno); goto error; } retry: if (sigprocmask(SIG_BLOCK, &h->sset, 0)==-1){ if (errno==EINTR) goto retry; - LOG(L_ERR, "ERROR: init_sigio: sigprocmask failed: %s [%d]\n", + LM_ERR("sigprocmask failed: %s [%d]\n", strerror(errno), errno); goto error; } @@ -206,8 +204,7 @@ again: h->epfd=epoll_create(h->max_fd_no); if (h->epfd==-1){ if (errno==EINTR) goto again; - LOG(L_ERR, "ERROR: init_epoll: epoll_create: %s [%d]\n", - strerror(errno), errno); + LM_ERR("epoll_create: %s [%d]\n", strerror(errno), errno); return -1; } return 0; @@ -235,8 +232,7 @@ again: h->kq_fd=kqueue(); if (h->kq_fd==-1){ if (errno==EINTR) goto again; - LOG(L_ERR, "ERROR: init_kqueue: kqueue: %s [%d]\n", - strerror(errno), errno); + LM_ERR("kqueue: %s [%d]\n", strerror(errno), errno); return -1; } return 0; @@ -264,8 +260,7 @@ again: h->dpoll_fd=open("/dev/poll", O_RDWR); if (h->dpoll_fd==-1){ if (errno==EINTR) goto again; - LOG(L_ERR, "ERROR: init_/dev/poll: open: %s [%d]\n", - strerror(errno), errno); + LM_ERR("open: %s [%d]\n", strerror(errno), errno); return -1; } return 0; @@ -478,11 +473,11 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method) if (poll_err || (poll_method==0)){ poll_method=choose_poll_method(); if (poll_err){ - LOG(L_ERR, "ERROR: init_io_wait: %s, using %s instead\n", + LM_ERR("%s, using %s instead\n", poll_err, poll_method_str[poll_method]); }else{ - LOG(L_INFO, "init_io_wait: using %s as the io watch method" - " (auto detected)\n", poll_method_str[poll_method]); + LM_INFO("using %s as the io watch method (auto detected)\n", + poll_method_str[poll_method]); } } @@ -491,8 +486,7 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method) /* common stuff, everybody has fd_hash */ h->fd_hash=local_malloc(sizeof(*(h->fd_hash))*h->max_fd_no); if (h->fd_hash==0){ - LOG(L_CRIT, "ERROR: init_io_wait: could not alloc" - " fd hashtable (%ld bytes)\n", + LM_CRIT("could not alloc fd hashtable (%ld bytes)\n", (long)sizeof(*(h->fd_hash))*h->max_fd_no ); goto error; } @@ -511,27 +505,26 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method) #endif h->fd_array=local_malloc(sizeof(*(h->fd_array))*h->max_fd_no); if (h->fd_array==0){ - LOG(L_CRIT, "ERROR: init_io_wait: could not" - " alloc fd array (%ld bytes)\n", - (long)sizeof(*(h->fd_hash))*h->max_fd_no); + LM_CRIT("could not alloc fd array (%ld bytes)\n", + (long)sizeof(*(h->fd_hash))*h->max_fd_no); goto error; } memset((void*)h->fd_array, 0, sizeof(*(h->fd_array))*h->max_fd_no); #ifdef HAVE_SIGIO_RT if ((poll_method==POLL_SIGIO_RT) && (init_sigio(h, 0)<0)){ - LOG(L_CRIT, "ERROR: init_io_wait: sigio init failed\n"); + LM_CRIT("sigio init failed\n"); goto error; } #endif #ifdef HAVE_DEVPOLL if ((poll_method==POLL_DEVPOLL) && (init_devpoll(h)<0)){ - LOG(L_CRIT, "ERROR: init_io_wait: /dev/poll init failed\n"); + LM_CRIT("/dev/poll init failed\n"); goto error; } #endif #ifdef HAVE_SELECT if ((poll_method==POLL_SELECT) && (init_select(h)<0)){ - LOG(L_CRIT, "ERROR: init_io_wait: select init failed\n"); + LM_CRIT("select init failed\n"); goto error; } #endif @@ -542,13 +535,12 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method) case POLL_EPOLL_ET: h->ep_array=local_malloc(sizeof(*(h->ep_array))*h->max_fd_no); if (h->ep_array==0){ - LOG(L_CRIT, "ERROR: init_io_wait: could not alloc" - " epoll array\n"); + LM_CRIT("could not alloc epoll array\n"); goto error; } memset((void*)h->ep_array, 0, sizeof(*(h->ep_array))*h->max_fd_no); if (init_epoll(h)<0){ - LOG(L_CRIT, "ERROR: init_io_wait: epoll init failed\n"); + LM_CRIT("epoll init failed\n"); goto error; } break; @@ -566,15 +558,13 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method) h->kq_array_size=2 * h->max_fd_no + h->kq_changes_size; h->kq_array=local_malloc(sizeof(*(h->kq_array))*h->kq_array_size); if (h->kq_array==0){ - LOG(L_CRIT, "ERROR: init_io_wait: could not alloc" - " kqueue event array\n"); + LM_CRIT("could not alloc kqueue event array\n"); goto error; } h->kq_changes=local_malloc(sizeof(*(h->kq_changes))* h->kq_changes_size); if (h->kq_changes==0){ - LOG(L_CRIT, "ERROR: init_io_wait: could not alloc" - " kqueue changes array\n"); + LM_CRIT("could not alloc kqueue changes array\n"); goto error; } h->kq_nchanges=0; @@ -583,14 +573,13 @@ int init_io_wait(io_wait_h* h, int max_fd, enum poll_types poll_method) memset((void*)h->kq_changes, 0, sizeof(*(h->kq_changes))* h->kq_changes_size); if (init_kqueue(h)<0){ - LOG(L_CRIT, "ERROR: init_io_wait: kqueue init failed\n"); + LM_CRIT("kqueue init failed\n"); goto error; } break; #endif default: - LOG(L_CRIT, "BUG: init_io_wait: unknown/unsupported poll" - " method %s (%d)\n", + LM_CRIT("unknown/unsupported poll method %s (%d)\n", poll_method_str[poll_method], poll_method); goto error; }
10 years, 3 months
1
0
0
0
git:master: io_wait.h: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 5716744ff21e7e7b15981f40652370e1a8f64248 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5716744…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 15:58:31 2014 -0400 io_wait.h: logging: convert LOG to LM_* --- io_wait.h | 169 ++++++++++++++++++++++++++----------------------------------- 1 files changed, 71 insertions(+), 98 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=571…
10 years, 3 months
1
0
0
0
git:master: stats.c: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 1faacc76a1c866beb9e63da5a370f6501dffbca1 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=1faacc7…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 15:23:10 2014 -0400 stats.c: logging: convert LOG to LM_* --- stats.c | 95 +++++++++++++++++++++++++++++++-------------------------------- 1 files changed, 47 insertions(+), 48 deletions(-) Diff:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=1fa…
10 years, 3 months
1
0
0
0
git:master: stats.h: logging: convert LOG to LM_*
by Ovidiu Sas
Module: sip-router Branch: master Commit: 849744c6ed72f324839ae4e02ae48393324bac51 URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=849744c…
Author: Ovidiu Sas <osas(a)voipembedded.com> Committer: Ovidiu Sas <osas(a)voipembedded.com> Date: Fri Oct 3 15:19:35 2014 -0400 stats.h: logging: convert LOG to LM_* --- stats.h | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/stats.h b/stats.h index 2eea3a8..4159184 100644 --- a/stats.h +++ b/stats.h @@ -49,8 +49,7 @@ case METHOD_BYE: stats->dir##_requests_bye++; break; \ case METHOD_INFO: stats->dir##_requests_info++; break; \ case METHOD_OTHER: stats->dir##_requests_other++; break; \ - default: LOG(L_ERR, "ERROR: unknown method in rq stats (%s)\n", \ - #dir); \ + default: LM_ERR("unknown method in rq stats (%s)\n", #dir); \ } \ }while(0) @@ -80,8 +79,7 @@ _statusline(4, dir) \ _statusline(5, dir) \ _statusline(6, dir) \ - default: LOG(L_INFO, "ERROR: unusual status code"\ - " received in stats (%s)\n", #dir); \ + default: LM_INFO("unusual status code received in stats (%s)\n", #dir); \ } \ }while(0)
10 years, 3 months
1
0
0
0
← Newer
1
...
31
32
33
34
35
36
37
38
39
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Results per page:
10
25
50
100
200