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
April
March
February
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 2016
----- 2025 -----
April 2025
March 2025
February 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
28 participants
234 discussions
Start a n
N
ew thread
Re: [sr-dev] [kamailio/kamailio] rr: more log details when 2nd rr with r2=on is not matching a local socket (b814c5a)
by Daniel-Constantin Mierla
27 Oct '16
27 Oct '16
Thanks, pushed a patch to fix it. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/commit/b814c5aadc690ceeca75e6ce25bf850…
1
0
0
0
git:master:e310762f: rr: fixed typo in log message
by Daniel-Constantin Mierla
27 Oct '16
27 Oct '16
Module: kamailio Branch: master Commit: e310762f71afd3e290e709f2d6786d44ce15ee1a URL:
https://github.com/kamailio/kamailio/commit/e310762f71afd3e290e709f2d6786d4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-10-27T11:26:43+02:00 rr: fixed typo in log message - due to previous commit - reported by Alberto Llamas --- Modified: modules/rr/loose.c --- Diff:
https://github.com/kamailio/kamailio/commit/
…
[View More]
e310762f71afd3e290e709f2d6786d4…
Patch:
https://github.com/kamailio/kamailio/commit/e310762f71afd3e290e709f2d6786d4…
--- diff --git a/modules/rr/loose.c b/modules/rr/loose.c index afcbbbc..ef68545 100644 --- a/modules/rr/loose.c +++ b/modules/rr/loose.c @@ -832,10 +832,10 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) set_force_socket(_m, si); } else { if (enable_socket_mismatch_warning) { - LM_WARN("no socket found for match second RR (%.*s)\n", + LM_WARN("no socket found to match second RR (%.*s)\n", rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s)); if(!is_myself(&puri)) { - LM_WARN("second RR uri si not myself (%.*s)\n", + LM_WARN("second RR uri is not myself (%.*s)\n", rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s)); } }
[View Less]
1
0
0
0
Re: [sr-dev] [kamailio/kamailio] rr: more log details when 2nd rr with r2=on is not matching a local socket (b814c5a)
by Alberto Llamas
27 Oct '16
27 Oct '16
There is a typo. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/commit/b814c5aadc690ceeca75e6ce25bf850…
1
0
0
0
git:master:b814c5aa: rr: more log details when 2nd rr with r2=on is not matching a local socket
by Daniel-Constantin Mierla
27 Oct '16
27 Oct '16
Module: kamailio Branch: master Commit: b814c5aadc690ceeca75e6ce25bf850ddfc4b44a URL:
https://github.com/kamailio/kamailio/commit/b814c5aadc690ceeca75e6ce25bf850…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2016-10-27T09:41:51+02:00 rr: more log details when 2nd rr with r2=on is not matching a local socket --- Modified: modules/rr/loose.c --- Diff:
https://github.com/kamailio/kamailio/commit/
…
[View More]
b814c5aadc690ceeca75e6ce25bf850…
Patch:
https://github.com/kamailio/kamailio/commit/b814c5aadc690ceeca75e6ce25bf850…
--- diff --git a/modules/rr/loose.c b/modules/rr/loose.c index 71d7d43..afcbbbc 100644 --- a/modules/rr/loose.c +++ b/modules/rr/loose.c @@ -125,7 +125,7 @@ static inline int find_first_route(struct sip_msg* _m) static inline int is_myself(sip_uri_t *_puri) { int ret; - + ret = check_self(&_puri->host, _puri->port_no?_puri->port_no:SIP_PORT, 0);/* match all protos*/ if (ret < 0) return 0; @@ -138,7 +138,7 @@ static inline int is_myself(sip_uri_t *_puri) return 0; } #endif - + if(ret==1) { /* match on host:port, but if gruu, then fail */ if(_puri->gr.s!=NULL) @@ -831,8 +831,14 @@ static inline int after_loose(struct sip_msg* _m, int preloaded) if (si) { set_force_socket(_m, si); } else { - if (enable_socket_mismatch_warning) - LM_WARN("no socket found for match second RR\n"); + if (enable_socket_mismatch_warning) { + LM_WARN("no socket found for match second RR (%.*s)\n", + rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s)); + if(!is_myself(&puri)) { + LM_WARN("second RR uri si not myself (%.*s)\n", + rt->nameaddr.uri.len, ZSW(rt->nameaddr.uri.s)); + } + } } }
[View Less]
1
0
0
0
git:master:0cfb2224: dmq_usrloc: Use ruid for saving/updating contacts
by Carsten Bock
25 Oct '16
25 Oct '16
Module: kamailio Branch: master Commit: 0cfb2224cbca5cfcf125ad46593573f1e4b94e36 URL:
https://github.com/kamailio/kamailio/commit/0cfb2224cbca5cfcf125ad46593573f…
Author: Carsten Bock <carsten(a)ng-voice.com> Committer: Carsten Bock <carsten(a)ng-voice.com> Date: 2016-10-25T17:37:36+02:00 dmq_usrloc: Use ruid for saving/updating contacts --- Modified: modules/dmq_usrloc/usrloc_sync.c --- Diff:
https://github.com/kamailio/kamailio/commit/0cfb2224cbca5cfcf125ad46593573f…
Patch:
…
[View More]
https://github.com/kamailio/kamailio/commit/0cfb2224cbca5cfcf125ad46593573f…
--- diff --git a/modules/dmq_usrloc/usrloc_sync.c b/modules/dmq_usrloc/usrloc_sync.c index c256af4..9fd6322 100644 --- a/modules/dmq_usrloc/usrloc_sync.c +++ b/modules/dmq_usrloc/usrloc_sync.c @@ -51,9 +51,9 @@ extern str _dmq_usrloc_domain; static int add_contact(str aor, ucontact_info_t* ci) { - urecord_t* r; + urecord_t* r = NULL; udomain_t* _d; - ucontact_t* c; + ucontact_t* c = NULL; str contact; int res; @@ -64,35 +64,52 @@ static int add_contact(str aor, ucontact_info_t* ci) dmq_ul.lock_udomain(_d, &aor); - res = dmq_ul.get_urecord(_d, &aor, &r); - if (res < 0) { - LM_ERR("failed to retrieve record from usrloc\n"); - goto error; - } else if ( res == 0) { - LM_DBG("'%.*s' found in usrloc\n", aor.len, ZSW(aor.s)); - res = dmq_ul.get_ucontact(r, ci->c, ci->callid, ci->path, ci->cseq, &c); - LM_DBG("get_ucontact = %d\n", res); - if (res==-1) { - LM_ERR("Invalid cseq\n"); + LM_DBG("aor: %.*s\n", aor.len, aor.s); + LM_DBG("ci->ruid: %.*s\n", ci->ruid.len, ci->ruid.s); + LM_DBG("aorhash: %i\n", dmq_ul.get_aorhash(&aor)); + + if (ci->ruid.len > 0) { + // Search by ruid, if possible + res = dmq_ul.get_urecord_by_ruid(_d, dmq_ul.get_aorhash(&aor), &ci->ruid, &r, &c); + if (res == 0) { + LM_DBG("Found contact\n"); + dmq_ul.update_ucontact(r, c, ci); + LM_DBG("Release record\n"); + dmq_ul.release_urecord(r); + LM_DBG("Unlock udomain\n"); + dmq_ul.unlock_udomain(_d, &aor); + return 0; + } + } + res = dmq_ul.get_urecord(_d, &aor, &r); + if (res < 0) { + LM_ERR("failed to retrieve record from usrloc\n"); goto error; - } else if (res > 0 ) { - LM_DBG("Not found contact\n"); + } else if ( res == 0) { + LM_DBG("'%.*s' found in usrloc\n", aor.len, ZSW(aor.s)); + res = dmq_ul.get_ucontact(r, ci->c, ci->callid, ci->path, ci->cseq, &c); + LM_DBG("get_ucontact = %d\n", res); + if (res==-1) { + LM_ERR("Invalid cseq\n"); + goto error; + } else if (res > 0 ) { + LM_DBG("Not found contact\n"); + contact.s = ci->c->s; + contact.len = ci->c->len; + dmq_ul.insert_ucontact(r, &contact, ci, &c); + } else if (res == 0) { + LM_DBG("Found contact\n"); + dmq_ul.update_ucontact(r, c, ci); + } + } else { + LM_DBG("'%.*s' Not found in usrloc\n", aor.len, ZSW(aor.s)); + dmq_ul.insert_urecord(_d, &aor, &r); + LM_DBG("Insert record\n"); contact.s = ci->c->s; contact.len = ci->c->len; dmq_ul.insert_ucontact(r, &contact, ci, &c); - } else if (res == 0) { - LM_DBG("Found contact\n"); - dmq_ul.update_ucontact(r, c, ci); + LM_DBG("Insert ucontact\n"); } - } else { - LM_DBG("'%.*s' Not found in usrloc\n", aor.len, ZSW(aor.s)); - dmq_ul.insert_urecord(_d, &aor, &r); - LM_DBG("Insert record\n"); - contact.s = ci->c->s; - contact.len = ci->c->len; - dmq_ul.insert_ucontact(r, &contact, ci, &c); - LM_DBG("Insert ucontact\n"); - } LM_DBG("Release record\n"); dmq_ul.release_urecord(r);
[View Less]
1
0
0
0
git:master:1460e478: sca: sca_call_info_update() fix [to|from]_aor values when using [to|from] header params
by Victor Seva
25 Oct '16
25 Oct '16
Module: kamailio Branch: master Commit: 1460e478d173681076ec106bafa15b7a424f42d0 URL:
https://github.com/kamailio/kamailio/commit/1460e478d173681076ec106bafa15b7…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2016-10-25T15:37:20+02:00 sca: sca_call_info_update() fix [to|from]_aor values when using [to|from] header params * params can have "<sip:user@domain>;tag=value" --- Modified: modules/
…
[View More]
sca/sca_call_info.c --- Diff:
https://github.com/kamailio/kamailio/commit/1460e478d173681076ec106bafa15b7…
Patch:
https://github.com/kamailio/kamailio/commit/1460e478d173681076ec106bafa15b7…
--- diff --git a/modules/sca/sca_call_info.c b/modules/sca/sca_call_info.c index 3d92908..58213b3 100644 --- a/modules/sca/sca_call_info.c +++ b/modules/sca/sca_call_info.c @@ -1900,8 +1900,11 @@ int sca_call_info_update(sip_msg_t *msg, char *p1, str *uri_to, str *uri_from) } LM_DBG("from[%.*s] param\n", STR_FMT(uri_from)); to_body_flags |= SCA_CALL_INFO_UPDATE_FLAG_FROM_ALLOC; - from_aor.s = uri_from->s; - from_aor.len = uri_from->len; + if (sca_uri_extract_aor(&from->uri, &from_aor) < 0) { + LM_ERR("Failed to extract AoR from From URI %.*s\n", + STR_FMT(&from->uri)); + goto done; + } } else if (sca_get_msg_from_header(msg, &from) < 0) { LM_ERR("Bad From header\n"); @@ -1914,8 +1917,11 @@ int sca_call_info_update(sip_msg_t *msg, char *p1, str *uri_to, str *uri_from) } LM_DBG("to[%.*s] param\n", STR_FMT(uri_to)); to_body_flags |= SCA_CALL_INFO_UPDATE_FLAG_TO_ALLOC; - to_aor.s = uri_to->s; - to_aor.len = uri_to->len; + if (sca_uri_extract_aor(&to->uri, &to_aor) < 0) { + LM_ERR("Failed to extract AoR from To URI %.*s\n", + STR_FMT(&to->uri)); + goto done; + } } else if (sca_get_msg_to_header(msg, &to) < 0) { LM_ERR("Bad To header\n"); @@ -1947,16 +1953,20 @@ int sca_call_info_update(sip_msg_t *msg, char *p1, str *uri_to, str *uri_from) } aor_flags |= SCA_CALL_INFO_UPDATE_FLAG_FROM_ALLOC; } - if (sca_uri_extract_aor(&to->uri, &to_aor) < 0) { - LM_ERR("Failed to extract AoR from To URI %.*s\n", - STR_FMT(&to->uri)); - goto done; + if (uri_to==NULL) { + if (sca_uri_extract_aor(&to->uri, &to_aor) < 0) { + LM_ERR("Failed to extract AoR from To URI %.*s\n", + STR_FMT(&to->uri)); + goto done; + } } } else { - if (sca_uri_extract_aor(&from->uri, &from_aor) < 0) { - LM_ERR("Failed to extract AoR from From URI %.*s\n", - STR_FMT(&from->uri)); - goto done; + if (uri_from==NULL) { + if (sca_uri_extract_aor(&from->uri, &from_aor) < 0) { + LM_ERR("Failed to extract AoR from From URI %.*s\n", + STR_FMT(&from->uri)); + goto done; + } } if (uri_to==NULL) { if (sca_create_canonical_aor(msg, &to_aor) < 0) {
[View Less]
1
0
0
0
git:master:0683df11: mem: TLSF bit ops cleanup / 64 bits improvement
by Camille Oudot
25 Oct '16
25 Oct '16
Module: kamailio Branch: master Commit: 0683df11e319aa3db45cd9b18af3a3c3b02088a8 URL:
https://github.com/kamailio/kamailio/commit/0683df11e319aa3db45cd9b18af3a3c…
Author: Camille Oudot <camille.oudot(a)orange.com> Committer: Camille Oudot <camille.oudot(a)orange.com> Date: 2016-10-25T11:32:35+02:00 mem: TLSF bit ops cleanup / 64 bits improvement - remove unsupproted compilers - use 64 bits __builtin_clzl() instead of twice 32 bits __builtin_clz() --- Modified: mem/
…
[View More]
tlsf_malloc_bits.h --- Diff:
https://github.com/kamailio/kamailio/commit/0683df11e319aa3db45cd9b18af3a3c…
Patch:
https://github.com/kamailio/kamailio/commit/0683df11e319aa3db45cd9b18af3a3c…
--- diff --git a/mem/tlsf_malloc_bits.h b/mem/tlsf_malloc_bits.h index 3be2579..29c783d 100644 --- a/mem/tlsf_malloc_bits.h +++ b/mem/tlsf_malloc_bits.h @@ -37,6 +37,8 @@ /* ** gcc 3.4 and above have builtin support, specialized for architecture. ** Some compilers masquerade as gcc; patchlevel test filters them out. +** +** Note: clang is compatible with GCC builtins and will also define those macros */ #if defined (__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) \ && defined (__GNUC_PATCHLEVEL__) @@ -52,78 +54,13 @@ tlsf_decl int tlsf_fls(unsigned int word) return bit - 1; } -#elif defined (_MSC_VER) && (_MSC_VER >= 1400) && (defined (_M_IX86) || defined (_M_X64)) -/* Microsoft Visual C++ support on x86/X64 architectures. */ - -#include <intrin.h> - -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward) - -tlsf_decl int tlsf_fls(unsigned int word) -{ - unsigned long index; - return _BitScanReverse(&index, word) ? index : -1; -} - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - unsigned long index; - return _BitScanForward(&index, word) ? index : -1; -} - -#elif defined (_MSC_VER) && defined (_M_PPC) -/* Microsoft Visual C++ support on PowerPC architectures. */ - -#include <ppcintrinsics.h> - -tlsf_decl int tlsf_fls(unsigned int word) -{ - const int bit = 32 - _CountLeadingZeros(word); - return bit - 1; -} - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - const unsigned int reverse = word & (~word + 1); - const int bit = 32 - _CountLeadingZeros(reverse); - return bit - 1; -} - -#elif defined (__ARMCC_VERSION) -/* RealView Compilation Tools for ARM */ - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - const unsigned int reverse = word & (~word + 1); - const int bit = 32 - __clz(reverse); - return bit - 1; -} - -tlsf_decl int tlsf_fls(unsigned int word) -{ - const int bit = word ? 32 - __clz(word) : 0; - return bit - 1; -} - -#elif defined (__ghs__) -/* Green Hills support for PowerPC */ - -#include <ppc_ghs.h> - -tlsf_decl int tlsf_ffs(unsigned int word) -{ - const unsigned int reverse = word & (~word + 1); - const int bit = 32 - __CLZ32(reverse); - return bit - 1; -} - -tlsf_decl int tlsf_fls(unsigned int word) +#if defined (TLSF_64BIT) +tlsf_decl int tlsf_fls_sizet(size_t size) { - const int bit = word ? 32 - __CLZ32(word) : 0; + const int bit = size ? 64 - __builtin_clzl(size) : 0; return bit - 1; } - +#endif #else /* Fall back to generic implementation. */ @@ -152,9 +89,6 @@ tlsf_decl int tlsf_fls(unsigned int word) return tlsf_fls_generic(word) - 1; } -#endif - -/* Possibly 64-bit version of tlsf_fls. */ #if defined (TLSF_64BIT) tlsf_decl int tlsf_fls_sizet(size_t size) { @@ -171,7 +105,12 @@ tlsf_decl int tlsf_fls_sizet(size_t size) } return bits; } -#else +#endif /* defined (TLSF_64BIT) */ + +#endif /* GNUC */ + + +#if !defined (TLSF_64BIT) #define tlsf_fls_sizet tlsf_fls #endif
[View Less]
1
0
0
0
git:master:bcc3857e: Merge pull request #829 from kamailio/janssonrpc-fix-memory-leak
by GitHub
24 Oct '16
24 Oct '16
Module: kamailio Branch: master Commit: bcc3857e21634485878eb82d89ca6f4e6b854934 URL:
https://github.com/kamailio/kamailio/commit/bcc3857e21634485878eb82d89ca6f4…
Author: Emmanuel Schmidbauer <emmanuel(a)getweave.com> Committer: GitHub <noreply(a)github.com> Date: 2016-10-24T17:49:37-04:00 Merge pull request #829 from kamailio/janssonrpc-fix-memory-leak janssonrpc-c: fix memory leak when using janssonrpc_notification --- Modified: modules/janssonrpc-c/janssonrpc_io.c --- Diff:
…
[View More]
https://github.com/kamailio/kamailio/commit/bcc3857e21634485878eb82d89ca6f4…
Patch:
https://github.com/kamailio/kamailio/commit/bcc3857e21634485878eb82d89ca6f4…
--- diff --git a/modules/janssonrpc-c/janssonrpc_io.c b/modules/janssonrpc-c/janssonrpc_io.c index ed0be6c..036032e 100644 --- a/modules/janssonrpc-c/janssonrpc_io.c +++ b/modules/janssonrpc-c/janssonrpc_io.c @@ -428,15 +428,18 @@ int jsonrpc_send(str conn, jsonrpc_request_t* req, bool notify_only) if(ns) pkg_free(ns); if(json) free(json); - if (sent && notify_only == false) { - - const struct timeval tv = ms_to_tv(req->timeout); + if (sent) { + if (notify_only == true) { // free the request if using janssonrpc_notification function + free_request(req); + } else { + const struct timeval tv = ms_to_tv(req->timeout); - req->timeout_ev = evtimer_new(global_ev_base, timeout_cb, (void*)req); - if(event_add(req->timeout_ev, &tv)<0) { - ERR("event_add failed while setting request timer (%s).", - strerror(errno)); - return -1; + req->timeout_ev = evtimer_new(global_ev_base, timeout_cb, (void*)req); + if(event_add(req->timeout_ev, &tv)<0) { + ERR("event_add failed while setting request timer (%s).", + strerror(errno)); + return -1; + } } }
[View Less]
1
0
0
0
git:master:c6b38e43: janssonrpc-c: fix memory leak when using janssonrpc_notification
by Emmanuel Schmidbauer
24 Oct '16
24 Oct '16
Module: kamailio Branch: master Commit: c6b38e437387aba003bef8ef9496d5a7568e9c97 URL:
https://github.com/kamailio/kamailio/commit/c6b38e437387aba003bef8ef9496d5a…
Author: Emmanuel Schmidbauer <emmanuel(a)getweave.com> Committer: Emmanuel Schmidbauer <emmanuel(a)getweave.com> Date: 2016-10-24T15:53:29-04:00 janssonrpc-c: fix memory leak when using janssonrpc_notification --- Modified: modules/janssonrpc-c/janssonrpc_io.c --- Diff:
https://github.com/kamailio/kamailio/commit/
…
[View More]
c6b38e437387aba003bef8ef9496d5a…
Patch:
https://github.com/kamailio/kamailio/commit/c6b38e437387aba003bef8ef9496d5a…
--- diff --git a/modules/janssonrpc-c/janssonrpc_io.c b/modules/janssonrpc-c/janssonrpc_io.c index ed0be6c..036032e 100644 --- a/modules/janssonrpc-c/janssonrpc_io.c +++ b/modules/janssonrpc-c/janssonrpc_io.c @@ -428,15 +428,18 @@ int jsonrpc_send(str conn, jsonrpc_request_t* req, bool notify_only) if(ns) pkg_free(ns); if(json) free(json); - if (sent && notify_only == false) { - - const struct timeval tv = ms_to_tv(req->timeout); + if (sent) { + if (notify_only == true) { // free the request if using janssonrpc_notification function + free_request(req); + } else { + const struct timeval tv = ms_to_tv(req->timeout); - req->timeout_ev = evtimer_new(global_ev_base, timeout_cb, (void*)req); - if(event_add(req->timeout_ev, &tv)<0) { - ERR("event_add failed while setting request timer (%s).", - strerror(errno)); - return -1; + req->timeout_ev = evtimer_new(global_ev_base, timeout_cb, (void*)req); + if(event_add(req->timeout_ev, &tv)<0) { + ERR("event_add failed while setting request timer (%s).", + strerror(errno)); + return -1; + } } }
[View Less]
1
0
0
0
[kamailio/kamailio] janssonrpc-c: fix memory leak when using janssonrpc_notification (#829)
by Emmanuel Schmidbauer
24 Oct '16
24 Oct '16
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/829
-- Commit Summary -- * janssonrpc-c: fix memory leak when using janssonrpc_notification -- File Changes -- M modules/janssonrpc-c/janssonrpc_io.c (19) -- Patch Links --
https://github.com/kamailio/kamailio/pull/829.patch
https://github.com/kamailio/kamailio/pull/829.diff
-- You are receiving this because you are subscribed to this thread. Reply to this email directly
…
[View More]
or view it on GitHub:
https://github.com/kamailio/kamailio/pull/829
[View Less]
2
3
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
24
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
Results per page:
10
25
50
100
200