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
2024
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
May 2021
----- 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
12 participants
287 discussions
Start a n
N
ew thread
git:5.4:1b517a7e: dialog: ignore 408 on keepalive with cseq 0
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.4 Commit: 1b517a7e560f20331aa94accca813825e0e0ff0b URL:
https://github.com/kamailio/kamailio/commit/1b517a7e560f20331aa94accca81382…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:28:19+02:00 dialog: ignore 408 on keepalive with cseq 0 - some UAs do not reply at all (cherry picked from commit 7aa8056a5e3a9804133cb9ff79640d8116be63da) (cherry picked from commit 6d71c9399027f2ed41cd6eae576d862440bd4fd4) --- Modified: src/modules/dialog/dlg_req_within.c --- Diff:
https://github.com/kamailio/kamailio/commit/1b517a7e560f20331aa94accca81382…
Patch:
https://github.com/kamailio/kamailio/commit/1b517a7e560f20331aa94accca81382…
--- diff --git a/src/modules/dialog/dlg_req_within.c b/src/modules/dialog/dlg_req_within.c index d48d139965..809834527f 100644 --- a/src/modules/dialog/dlg_req_within.c +++ b/src/modules/dialog/dlg_req_within.c @@ -271,6 +271,12 @@ void dlg_ka_cb_all(struct cell* t, int type, struct tmcb_params* ps, int dir) LM_DBG("skip updating non-confirmed dialogs\n"); goto done; } + if(ps->code==408 && (dlg->cseq[dir].len==0 + || (dlg->cseq[dir].len==1 && dlg->cseq[dir].s[0]=='\0'))) { + LM_DBG("ignore 408 for %s cseq 0\n", + ((dir==DLG_CALLER_LEG)?"caller":"callee")); + goto done; + } tend = 0; if(dir==DLG_CALLER_LEG) { dlg->ka_src_counter++;
3 years, 6 months
1
0
0
0
git:5.4:078c6f86: tls: declare variable based on SSL_CTX_set_ecdh_auto
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.4 Commit: 078c6f861fc52c28546dae5ce335002e5d5df99f URL:
https://github.com/kamailio/kamailio/commit/078c6f861fc52c28546dae5ce335002…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:26:26+02:00 tls: declare variable based on SSL_CTX_set_ecdh_auto - fix unused variable warning introduced in previous commit (cherry picked from commit 41b5e9473d79409712d46fdbb5a0b943ab880aa7) (cherry picked from commit 52c7d2f4d6704c7ea232808110fc09c17c90c4db) --- Modified: src/modules/tls/tls_domain.c --- Diff:
https://github.com/kamailio/kamailio/commit/078c6f861fc52c28546dae5ce335002…
Patch:
https://github.com/kamailio/kamailio/commit/078c6f861fc52c28546dae5ce335002…
--- diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c index 22897075c7..7ad847d2e4 100644 --- a/src/modules/tls/tls_domain.c +++ b/src/modules/tls/tls_domain.c @@ -63,7 +63,9 @@ extern EVP_PKEY * tls_engine_private_key(const char* key_id); #if !defined(OPENSSL_NO_ECDH) && !defined(OPENSSL_VERSION_1_1) static void setup_ecdh(SSL_CTX *ctx) { +#if !defined(SSL_CTX_set_ecdh_auto) EC_KEY *ecdh; +#endif if (SSLeay() < 0x1000005fL) { return;
3 years, 6 months
1
0
0
0
git:5.4:cd8a871c: msrp: destroy str array on error
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.4 Commit: cd8a871c5a4c6446eddc48bd89bfe5cde89a6c21 URL:
https://github.com/kamailio/kamailio/commit/cd8a871c5a4c6446eddc48bd89bfe5c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:26:05+02:00 msrp: destroy str array on error - some code reformatting (cherry picked from commit 4695b48b23e22135049f67a6ef362e933a0cf337) (cherry picked from commit 33cf417e59b4c7f0e45b6258644bae364ad2e912) --- Modified: src/modules/msrp/msrp_parser.c --- Diff:
https://github.com/kamailio/kamailio/commit/cd8a871c5a4c6446eddc48bd89bfe5c…
Patch:
https://github.com/kamailio/kamailio/commit/cd8a871c5a4c6446eddc48bd89bfe5c…
--- diff --git a/src/modules/msrp/msrp_parser.c b/src/modules/msrp/msrp_parser.c index 7defaf9353..c701d6a6ca 100644 --- a/src/modules/msrp/msrp_parser.c +++ b/src/modules/msrp/msrp_parser.c @@ -610,7 +610,7 @@ msrp_hdr_t *msrp_get_hdr_by_id(msrp_frame_t *mf, int hdrid) /** * */ -int msrp_explode_str(str **arr, str *in, str *del) +int msrp_explode_str(str_array_t *arr, str *in, str *del) { str *larr; int i; @@ -633,20 +633,20 @@ int msrp_explode_str(str **arr, str *in, str *del) } n++; - larr = pkg_malloc(n * sizeof(str)); + larr = pkg_mallocxz(n * sizeof(str)); if(larr==NULL) { LM_ERR("no more pkg\n"); return -1; } - memset(larr, 0, n * sizeof(str)); k = 0; if(n==1) { larr[k].s = in->s; larr[k].len = in->len; - *arr = larr; + arr->list = larr; + arr->size = n; return n; } @@ -657,19 +657,23 @@ int msrp_explode_str(str **arr, str *in, str *del) { if(in->s[i]==del->s[j]) { - if(k<n) + if(k<n) { larr[k].len = in->s + i - larr[k].s; + } k++; - if(k<n) + if(k<n) { larr[k].s = in->s + i + 1; + } break; } } } - if(k<n) + if(k<n) { larr[k].len = in->s + i - larr[k].s; + } - *arr = larr; + arr->list = larr; + arr->size = n; return n; } @@ -677,7 +681,7 @@ int msrp_explode_str(str **arr, str *in, str *del) /** * */ -int msrp_explode_strz(str **arr, str *in, char *del) +int msrp_explode_strz(str_array_t *arr, str *in, char *del) { str s; @@ -693,7 +697,7 @@ void msrp_str_array_destroy(void *data) return; arr = (str_array_t*)data; if(arr->list!=NULL) - pkg_free(arr->list); + pkg_free(arr->list); pkg_free(arr); } @@ -705,20 +709,19 @@ int msrp_parse_hdr_uri_list(msrp_hdr_t *hdr) str_array_t *arr; str s; - arr = pkg_malloc(sizeof(str_array_t)); + arr = pkg_mallocxz(sizeof(str_array_t)); if(arr==NULL) { LM_ERR("no more pkg\n"); return -1; } - memset(arr, 0, sizeof(str_array_t)); s = hdr->body; trim(&s); - arr->size = msrp_explode_strz(&arr->list, &s, " "); - if(arr->size<0) + if(msrp_explode_strz(arr, &s, " ")<0) { LM_ERR("failed to explode\n"); + msrp_str_array_destroy(arr); return -1; } hdr->parsed.flags |= MSRP_DATA_SET;
3 years, 6 months
1
0
0
0
git:5.4:1142d547: [tls] Don't use OpenSSL<1.0.2 fallback on 1.1+
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.4 Commit: 1142d5470d40801743af2fd9e27213bae6c394f4 URL:
https://github.com/kamailio/kamailio/commit/1142d5470d40801743af2fd9e27213b…
Author: SPChan <shihping.chan(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:25:25+02:00 [tls] Don't use OpenSSL<1.0.2 fallback on 1.1+ Address GH #2716. Also see
https://bugs.python.org/issue29697
. (cherry picked from commit 27904530d1f8efd26e2b96fa5f18a3aad887919b) (cherry picked from commit 1c7a8459f1a5b0f4d96f3908a301b599d5e24dc3) --- Modified: src/modules/tls/tls_domain.c --- Diff:
https://github.com/kamailio/kamailio/commit/1142d5470d40801743af2fd9e27213b…
Patch:
https://github.com/kamailio/kamailio/commit/1142d5470d40801743af2fd9e27213b…
--- diff --git a/src/modules/tls/tls_domain.c b/src/modules/tls/tls_domain.c index a8859c4a31..22897075c7 100644 --- a/src/modules/tls/tls_domain.c +++ b/src/modules/tls/tls_domain.c @@ -55,8 +55,12 @@ extern EVP_PKEY * tls_engine_private_key(const char* key_id); * ECDHE is enabled only on OpenSSL 1.0.0e and later. * See
http://www.openssl.org/news/secadv_20110906.txt
* for details. + * Also, copied from _ssl.c of Python for correct initialization. + * Allow automatic ECDH curve selection (on OpenSSL 1.0.2+), or use + * prime256v1 by default. This is Apache mod_ssl's initialization + * policy, so we should be safe. OpenSSL 1.1 has it enabled by default. */ -#ifndef OPENSSL_NO_ECDH +#if !defined(OPENSSL_NO_ECDH) && !defined(OPENSSL_VERSION_1_1) static void setup_ecdh(SSL_CTX *ctx) { EC_KEY *ecdh; @@ -65,11 +69,15 @@ static void setup_ecdh(SSL_CTX *ctx) return; } +#if defined(SSL_CTX_set_ecdh_auto) + SSL_CTX_set_ecdh_auto(ctx, 1); +#else ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); SSL_CTX_set_options(ctx, SSL_OP_SINGLE_ECDH_USE); SSL_CTX_set_tmp_ecdh(ctx, ecdh); EC_KEY_free(ecdh); +#endif } #endif @@ -670,7 +678,7 @@ static int set_cipher_list(tls_domain_t* d) tls_domain_str(d), cipher_list); return -1; } -#ifndef OPENSSL_NO_ECDH +#if !defined(OPENSSL_NO_ECDH) && !defined(OPENSSL_VERSION_1_1) setup_ecdh(d->ctx[i]); #endif #ifndef OPENSSL_NO_DH
3 years, 6 months
1
0
0
0
git:5.4:bde591dc: msrp: check return code for str explode
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.4 Commit: bde591dc9507eaea0b744112d49ea01fbdf8f555 URL:
https://github.com/kamailio/kamailio/commit/bde591dc9507eaea0b744112d49ea01…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:24:32+02:00 msrp: check return code for str explode (cherry picked from commit addb6a88d0266a0bb0545077fb0b5b8a3fdcca8e) (cherry picked from commit e55ecc6412997b55569f3b626a681eae0ca312df) --- Modified: src/modules/msrp/msrp_parser.c --- Diff:
https://github.com/kamailio/kamailio/commit/bde591dc9507eaea0b744112d49ea01…
Patch:
https://github.com/kamailio/kamailio/commit/bde591dc9507eaea0b744112d49ea01…
--- diff --git a/src/modules/msrp/msrp_parser.c b/src/modules/msrp/msrp_parser.c index 4e5e67e130..7defaf9353 100644 --- a/src/modules/msrp/msrp_parser.c +++ b/src/modules/msrp/msrp_parser.c @@ -716,6 +716,11 @@ int msrp_parse_hdr_uri_list(msrp_hdr_t *hdr) s = hdr->body; trim(&s); arr->size = msrp_explode_strz(&arr->list, &s, " "); + if(arr->size<0) + { + LM_ERR("failed to explode\n"); + return -1; + } hdr->parsed.flags |= MSRP_DATA_SET; hdr->parsed.free_fn = msrp_str_array_destroy; hdr->parsed.data = arr;
3 years, 6 months
1
0
0
0
git:5.4:cf1f5043: dispatcher: docs - set xmlns for include tags
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.4 Commit: cf1f5043fd346a1106071cad2f5e294ce7e32fd9 URL:
https://github.com/kamailio/kamailio/commit/cf1f5043fd346a1106071cad2f5e294…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:23:01+02:00 dispatcher: docs - set xmlns for include tags (cherry picked from commit 3f25ef01c5cc3adb02dd1bfecdfd4c3ce80cef47) (cherry picked from commit 6b9ecb0856a881144546fea6d3cbd8a3dc668b81) --- Modified: src/modules/dispatcher/doc/dispatcher.xml Modified: src/modules/dispatcher/doc/dispatcher_admin.xml --- Diff:
https://github.com/kamailio/kamailio/commit/cf1f5043fd346a1106071cad2f5e294…
Patch:
https://github.com/kamailio/kamailio/commit/cf1f5043fd346a1106071cad2f5e294…
--- diff --git a/src/modules/dispatcher/doc/dispatcher.xml b/src/modules/dispatcher/doc/dispatcher.xml index 3888e5f281..af040e737d 100644 --- a/src/modules/dispatcher/doc/dispatcher.xml +++ b/src/modules/dispatcher/doc/dispatcher.xml @@ -6,12 +6,9 @@ <!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml"> %docentities; -<!ENTITY % xinclude SYSTEM "
http://www.docbook.org/xml/4.4/xinclude.mod
" > -%xinclude; - ]> -<book xmlns:xi="
http://www.w3.org/2001/XInclude
"> +<book> <bookinfo> <title>DISPATCHER Module</title> <productname class="trade">&kamailioname;</productname> @@ -97,7 +94,7 @@ </bookinfo> <toc/> - <xi:include href="dispatcher_admin.xml"/> - <xi:include href="dispatcher_faq.xml"/> + <xi:include xmlns:xi="
http://www.w3.org/2001/XInclude
" href="dispatcher_admin.xml"/> + <xi:include xmlns:xi="
http://www.w3.org/2001/XInclude
" href="dispatcher_faq.xml"/> </book> diff --git a/src/modules/dispatcher/doc/dispatcher_admin.xml b/src/modules/dispatcher/doc/dispatcher_admin.xml index 11fff9c7d6..30f32ca038 100644 --- a/src/modules/dispatcher/doc/dispatcher_admin.xml +++ b/src/modules/dispatcher/doc/dispatcher_admin.xml @@ -1,18 +1,15 @@ <?xml version="1.0" encoding='ISO-8859-1'?> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "
http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd
" [ - + <!-- Include general documentation entities --> <!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml"> %docentities; -<!ENTITY % xinclude SYSTEM "
http://www.docbook.org/xml/4.4/xinclude.mod
" > -%xinclude; - ]> <!-- Module User's Guide --> -<chapter xmlns:xi="
http://www.w3.org/2001/XInclude
"> +<chapter> <title>&adminguide;</title> @@ -2170,7 +2167,7 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt) <title>dispatcher list file</title> <programlisting format="linespecific"> ... -<xi:include href="dispatcher.list" parse="text"/> +<xi:include xmlns:xi="
http://www.w3.org/2001/XInclude
" href="dispatcher.list" parse="text"/> ... </programlisting> </example> @@ -2186,7 +2183,7 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt) <title>&kamailio; config script - sample dispatcher usage</title> <programlisting format="linespecific"> ... -<xi:include href="dispatcher.cfg" parse="text"/> +<xi:include xmlns:xi="
http://www.w3.org/2001/XInclude
" href="dispatcher.cfg" parse="text"/> ... </programlisting> </example>
3 years, 6 months
1
0
0
0
git:5.4:b95e319d: core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.4 Commit: b95e319d006a38fcc6385d704de82e553f7c2236 URL:
https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e5…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:23:45+02:00 core/mem: q_malloc - use #else with DBG_QM_MALLOC for debug on freed fragments (cherry picked from commit 764d5be0c44036bb4b86f841588fb0df3b4bb834) (cherry picked from commit fc90e4c06c5df8c8a9d5cd615923c09a93b5a810) --- Modified: src/core/mem/q_malloc.c --- Diff:
https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e5…
Patch:
https://github.com/kamailio/kamailio/commit/b95e319d006a38fcc6385d704de82e5…
--- diff --git a/src/core/mem/q_malloc.c b/src/core/mem/q_malloc.c index b518bfab81..b0f7625a40 100644 --- a/src/core/mem/q_malloc.c +++ b/src/core/mem/q_malloc.c @@ -509,7 +509,7 @@ void qm_free(void* qmp, void* p) #ifdef DBG_QM_MALLOC qm_debug_frag(qm, f, file, line); - if (f->u.is_free){ + if (unlikely(f->u.is_free)){ if(likely(cfg_get(core, core_cfg, mem_safety)==0)) { LM_CRIT("BUG: freeing already freed pointer (%p)," " called from %s: %s(%d), first free %s: %s(%ld) - aborting\n", @@ -524,12 +524,13 @@ void qm_free(void* qmp, void* p) } MDBG("freeing frag. %p alloc'ed from %s: %s(%ld)\n", f, f->file, f->func, f->line); -#endif +#else if (unlikely(f->u.is_free)){ LM_INFO("freeing a free fragment (%p/%p) - ignore\n", f, p); return; } +#endif size=f->size; qm->used-=size;
3 years, 6 months
1
0
0
0
git:5.5:b62a773c: pike: fixed regression
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.5 Commit: b62a773c8f0c1daf1aa3d1cd57845d414eea5bac URL:
https://github.com/kamailio/kamailio/commit/b62a773c8f0c1daf1aa3d1cd57845d4…
Author: Boris Korzun <korzun(a)miatel.ru> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:14:54+02:00 pike: fixed regression - removed unnecessary NULL-return from mark_node() after previous commit (cherry picked from commit 79fbb7c6df5d4c742b1283b752c2df0f51e77f09) --- Modified: src/modules/pike/ip_tree.c --- Diff:
https://github.com/kamailio/kamailio/commit/b62a773c8f0c1daf1aa3d1cd57845d4…
Patch:
https://github.com/kamailio/kamailio/commit/b62a773c8f0c1daf1aa3d1cd57845d4…
--- diff --git a/src/modules/pike/ip_tree.c b/src/modules/pike/ip_tree.c index c0324c0476..1fe9227a5f 100644 --- a/src/modules/pike/ip_tree.c +++ b/src/modules/pike/ip_tree.c @@ -301,10 +301,6 @@ pike_ip_node_t* mark_node(unsigned char *ip,int ip_len, } } - if(node==NULL) { - return NULL; - } - LM_DBG("only first %d were matched!\n",byte_pos); *flag = 0; *father = 0;
3 years, 6 months
1
0
0
0
git:5.5:baea325a: core: ut - fixed str_casesearch()
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.5 Commit: baea325ab832a9f96e70c41f3aa542b7b99553fe URL:
https://github.com/kamailio/kamailio/commit/baea325ab832a9f96e70c41f3aa542b…
Author: Boris Korzun <korzun(a)miatel.ru> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:14:42+02:00 core: ut - fixed str_casesearch() - fixed str_casesearch() behaviour on text and needle were equal (cherry picked from commit c146ef490e1d7d35add7d3ee593f6d3d20e327ad) --- Modified: src/core/ut.c --- Diff:
https://github.com/kamailio/kamailio/commit/baea325ab832a9f96e70c41f3aa542b…
Patch:
https://github.com/kamailio/kamailio/commit/baea325ab832a9f96e70c41f3aa542b…
--- diff --git a/src/core/ut.c b/src/core/ut.c index 08edd2f24e..c3849fcc24 100644 --- a/src/core/ut.c +++ b/src/core/ut.c @@ -327,7 +327,7 @@ char *stre_search_strz(char *vstart, char *vend, char *needlez) char *str_casesearch(str *text, str *needle) { int i,j; - for(i=0;i<text->len-needle->len;i++) { + for(i=0;i<=text->len-needle->len;i++) { for(j=0;j<needle->len;j++) { if ( !((text->s[i+j]==needle->s[j]) || ( isalpha((int)text->s[i+j]) @@ -337,7 +337,7 @@ char *str_casesearch(str *text, str *needle) if (j==needle->len) return text->s+i; } - return 0; + return NULL; } /**
3 years, 6 months
1
0
0
0
git:5.5:655518a9: core: clone define value to avoid losing the reference
by Daniel-Constantin Mierla
Module: kamailio Branch: 5.5 Commit: 655518a94d413250c4b0246a5e91df7506a5427d URL:
https://github.com/kamailio/kamailio/commit/655518a94d413250c4b0246a5e91df7…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2021-05-26T08:14:33+02:00 core: clone define value to avoid losing the reference - impacted also by substdef - GH #2736 (cherry picked from commit 84055b2fe963e01a217149991dd1c8cbe8a8aeec) --- Modified: src/core/cfg.lex Modified: src/core/ppcfg.c Modified: src/core/ppcfg.h Modified: src/main.c --- Diff:
https://github.com/kamailio/kamailio/commit/655518a94d413250c4b0246a5e91df7…
Patch:
https://github.com/kamailio/kamailio/commit/655518a94d413250c4b0246a5e91df7…
--- diff --git a/src/core/cfg.lex b/src/core/cfg.lex index 2b90fbb66a..ff8096d9f2 100644 --- a/src/core/cfg.lex +++ b/src/core/cfg.lex @@ -1337,7 +1337,7 @@ IMPORTFILE "import_file" <DEFINE_DATA>\\{CR} { count(); ksr_cfg_print_part(yytext); } /* eat the escaped CR */ <DEFINE_DATA>{CR} { count(); ksr_cfg_print_part(yytext); - if (pp_define_set(strlen(s_buf.s), s_buf.s)) return 1; + if (pp_define_set(strlen(s_buf.s), s_buf.s, KSR_PPDEF_NORMAL)) return 1; memset(&s_buf, 0, sizeof(s_buf)); state = INITIAL; ksr_cfg_print_initial_state(); @@ -2007,7 +2007,7 @@ int pp_define(int len, const char *text) return 0; } -int pp_define_set(int len, char *text) +int pp_define_set(int len, char *text, int mode) { int ppos; @@ -2090,7 +2090,7 @@ int pp_define_env(const char *text, int len) LM_ERR("cannot set define name [%s]\n", (char*)text); return -1; } - if(pp_define_set(defvalue.len, defvalue.s)<0) { + if(pp_define_set(defvalue.len, defvalue.s, KSR_PPDEF_NORMAL)<0) { LM_ERR("cannot set define value [%s]\n", (char*)text); return -1; } diff --git a/src/core/ppcfg.c b/src/core/ppcfg.c index 627402ba66..a5aa1d3e28 100644 --- a/src/core/ppcfg.c +++ b/src/core/ppcfg.c @@ -143,20 +143,14 @@ int pp_substdef_add(char *data, int mode) LM_ERR("cannot set define name\n"); goto error; } - if(mode==1) { - /* define the value enclosed in double quotes */ - *(defvalue.s-1) = '"'; - defvalue.s[defvalue.len] = '"'; - defvalue.s--; - defvalue.len += 2; - } if(memchr(defvalue.s, '$', defvalue.len) != NULL) { fmsg = faked_msg_get_next(); if(pv_eval_str(fmsg, &newval, &defvalue)>=0) { defvalue = newval; } } - if(pp_define_set(defvalue.len, defvalue.s)<0) { + if(pp_define_set(defvalue.len, defvalue.s, + (mode==1)?KSR_PPDEF_QUOTED:KSR_PPDEF_NORMAL)<0) { LM_ERR("cannot set define value\n"); goto error; } diff --git a/src/core/ppcfg.h b/src/core/ppcfg.h index 70627268b6..17b19380bc 100644 --- a/src/core/ppcfg.h +++ b/src/core/ppcfg.h @@ -25,6 +25,9 @@ #include "str.h" +#define KSR_PPDEF_NORMAL (0) /* define normal value */ +#define KSR_PPDEF_QUOTED (1<<0) /* define quoted value */ + typedef struct ksr_ppdefine { str name; str value; @@ -39,7 +42,7 @@ int pp_substdef_add(char *data, int mode); int pp_subst_run(char **data); int pp_define(int len, const char *text); -int pp_define_set(int len, char *text); +int pp_define_set(int len, char *text, int mode); int pp_define_set_type(int type); str *pp_define_get(int len, const char * text); int pp_define_env(const char * text, int len); diff --git a/src/main.c b/src/main.c index 71a024d5bb..a391f57afb 100644 --- a/src/main.c +++ b/src/main.c @@ -2264,7 +2264,7 @@ int main(int argc, char** argv) } if(p) { p++; - if(pp_define_set(strlen(p), p)<0) { + if(pp_define_set(strlen(p), p, KSR_PPDEF_NORMAL)<0) { fprintf(stderr, "error at define value: -A %s\n", optarg); goto error;
3 years, 6 months
1
0
0
0
← Newer
1
...
10
11
12
13
14
15
16
...
29
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
Results per page:
10
25
50
100
200