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
November 2019
----- 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
22 participants
380 discussions
Start a n
N
ew thread
git:master:278ff3a0: db_redis: declare variables at the beginning of the function (GH #2146)
by Henning Westerholt
Module: kamailio Branch: master Commit: 278ff3a0265a3e3a4321d98555083c6e73669546 URL:
https://github.com/kamailio/kamailio/commit/278ff3a0265a3e3a4321d98555083c6…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-24T09:03:27+01:00 db_redis: declare variables at the beginning of the function (GH #2146) - declare variables at the beginning of the function (GH #2146) - error message: redis_dbase.c: In function 'db_redis_scan_query_keys': redis_dbase.c:1086:5: error: 'for' loop initial declarations are only allowed in C99 mode for (redis_key_t *set_key = set_keys; set_key; set_key = set_key->next) --- Modified: src/modules/db_redis/redis_dbase.c --- Diff:
https://github.com/kamailio/kamailio/commit/278ff3a0265a3e3a4321d98555083c6…
Patch:
https://github.com/kamailio/kamailio/commit/278ff3a0265a3e3a4321d98555083c6…
--- diff --git a/src/modules/db_redis/redis_dbase.c b/src/modules/db_redis/redis_dbase.c index 50d1a62b10..5061b8e447 100644 --- a/src/modules/db_redis/redis_dbase.c +++ b/src/modules/db_redis/redis_dbase.c @@ -923,6 +923,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, char *match = NULL; int ret; redisReply *reply = NULL; + redis_key_t *set_key = NULL; int i, j; *query_keys = NULL; @@ -1083,7 +1084,7 @@ static int db_redis_scan_query_keys(km_redis_con_t *con, const str *table_name, ret = -1; - for (redis_key_t *set_key = set_keys; set_key; set_key = set_key->next) { + for (set_key = set_keys; set_key; set_key = set_key->next) { LM_DBG("pulling set members from key '%.*s'\n", set_key->key.len, set_key->key.s); redis_key_t *query_v = NULL;
5 years
1
0
0
0
git:master:b0d7cef1: call_control: remove redundant str trim implementation and use the one from core
by Henning Westerholt
Module: kamailio Branch: master Commit: b0d7cef110c580073cfb089ac348347f63b8cce1 URL:
https://github.com/kamailio/kamailio/commit/b0d7cef110c580073cfb089ac348347…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T23:19:32+01:00 call_control: remove redundant str trim implementation and use the one from core --- Modified: src/modules/call_control/call_control.c --- Diff:
https://github.com/kamailio/kamailio/commit/b0d7cef110c580073cfb089ac348347…
Patch:
https://github.com/kamailio/kamailio/commit/b0d7cef110c580073cfb089ac348347…
--- diff --git a/src/modules/call_control/call_control.c b/src/modules/call_control/call_control.c index 75179c73dc..98de64523d 100644 --- a/src/modules/call_control/call_control.c +++ b/src/modules/call_control/call_control.c @@ -40,6 +40,7 @@ #include "../../core/str.h" #include "../../core/pvar.h" #include "../../core/ut.h" +#include "../../core/trim.h" #include "../../core/script_cb.h" #include "../../core/parser/digest/digest.h" #include "../../core/parser/parse_from.h" @@ -351,41 +352,6 @@ parse_param_stop(unsigned int type, void *val) { } -// Functions dealing with strings -// - -// returns string with whitespace trimmed from left end -static inline void -ltrim(str *string) -{ - while (string->len>0 && isspace((int)*(string->s))) { - string->len--; - string->s++; - } -} - -// returns string with whitespace trimmed from right end -static inline void -rtrim(str *string) -{ - char *ptr; - - ptr = string->s + string->len - 1; - while (string->len>0 && (*ptr==0 || isspace((int)*ptr))) { - string->len--; - ptr--; - } -} - -// returns string with whitespace trimmed from both ends -static inline void -trim(str *string) -{ - ltrim(string); - rtrim(string); -} - - // Message checking and parsing //
5 years
1
0
0
0
git:master:b8aafb37: mediaproxy: remove redundant str trim implementation and use the one from core
by Henning Westerholt
Module: kamailio Branch: master Commit: b8aafb37245c76f9146e192c3580ed83d254a63e URL:
https://github.com/kamailio/kamailio/commit/b8aafb37245c76f9146e192c3580ed8…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T23:17:07+01:00 mediaproxy: remove redundant str trim implementation and use the one from core --- Modified: src/modules/mediaproxy/mediaproxy.c --- Diff:
https://github.com/kamailio/kamailio/commit/b8aafb37245c76f9146e192c3580ed8…
Patch:
https://github.com/kamailio/kamailio/commit/b8aafb37245c76f9146e192c3580ed8…
--- diff --git a/src/modules/mediaproxy/mediaproxy.c b/src/modules/mediaproxy/mediaproxy.c index 29ceca4d3f..c2a22f0007 100644 --- a/src/modules/mediaproxy/mediaproxy.c +++ b/src/modules/mediaproxy/mediaproxy.c @@ -41,6 +41,7 @@ #include "../../core/data_lump.h" #include "../../core/mem/mem.h" #include "../../core/ut.h" +#include "../../core/trim.h" #include "../../core/parser/msg_parser.h" #include "../../core/parser/parse_from.h" #include "../../core/parser/parse_to.h" @@ -289,33 +290,6 @@ static void *strcasefind( return NULL; } -// returns string with whitespace trimmed from left end -static INLINE void ltrim(str *string) -{ - while(string->len > 0 && isspace((int)*(string->s))) { - string->len--; - string->s++; - } -} - -// returns string with whitespace trimmed from right end -static INLINE void rtrim(str *string) -{ - char *ptr; - - ptr = string->s + string->len - 1; - while(string->len > 0 && (*ptr == 0 || isspace((int)*ptr))) { - string->len--; - ptr--; - } -} - -// returns string with whitespace trimmed from both ends -static INLINE void trim(str *string) -{ - ltrim(string); - rtrim(string); -} // returns a pointer to first CR or LF char found or the end of string static char *findendline(char *string, int len)
5 years
1
0
0
0
git:master:cb41fc36: nat_traversal: remove not needed (and redundant) str trim implementation
by Henning Westerholt
Module: kamailio Branch: master Commit: cb41fc36a123d1fc3f9b30368ecd37ffa88c0730 URL:
https://github.com/kamailio/kamailio/commit/cb41fc36a123d1fc3f9b30368ecd37f…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T23:14:16+01:00 nat_traversal: remove not needed (and redundant) str trim implementation --- Modified: src/modules/nat_traversal/nat_traversal.c --- Diff:
https://github.com/kamailio/kamailio/commit/cb41fc36a123d1fc3f9b30368ecd37f…
Patch:
https://github.com/kamailio/kamailio/commit/cb41fc36a123d1fc3f9b30368ecd37f…
--- diff --git a/src/modules/nat_traversal/nat_traversal.c b/src/modules/nat_traversal/nat_traversal.c index 7bf0ae8c02..709b9032cd 100644 --- a/src/modules/nat_traversal/nat_traversal.c +++ b/src/modules/nat_traversal/nat_traversal.c @@ -730,34 +730,6 @@ static bool Dialog_Param_add_candidate(Dialog_Param *param, char *candidate) // Miscellaneous helper functions // -// returns str with leading whitespace removed -static INLINE void ltrim(str *string) -{ - while(string->len > 0 && isspace((int)*(string->s))) { - string->len--; - string->s++; - } -} - -// returns str with trailing whitespace removed -static INLINE void rtrim(str *string) -{ - char *ptr; - - ptr = string->s + string->len - 1; - while(string->len > 0 && (*ptr == 0 || isspace((int)*ptr))) { - string->len--; - ptr--; - } -} - -// returns str with leading and trailing whitespace removed -static INLINE void trim(str *string) -{ - ltrim(string); - rtrim(string); -} - static bool get_contact_uri( struct sip_msg *msg, struct sip_uri *uri, contact_t **_c) {
5 years
1
0
0
0
git:master:f427ac80: jsonrpcc: use core string handling instead of redundant implementation
by Henning Westerholt
Module: kamailio Branch: master Commit: f427ac803b8d2b33970da5071ecb9f9db5c25499 URL:
https://github.com/kamailio/kamailio/commit/f427ac803b8d2b33970da5071ecb9f9…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T23:01:28+01:00 jsonrpcc: use core string handling instead of redundant implementation --- Modified: src/modules/jsonrpcc/jsonrpc_request.c --- Diff:
https://github.com/kamailio/kamailio/commit/f427ac803b8d2b33970da5071ecb9f9…
Patch:
https://github.com/kamailio/kamailio/commit/f427ac803b8d2b33970da5071ecb9f9…
--- diff --git a/src/modules/jsonrpcc/jsonrpc_request.c b/src/modules/jsonrpcc/jsonrpc_request.c index 9032bddaaf..d2321e5f37 100644 --- a/src/modules/jsonrpcc/jsonrpc_request.c +++ b/src/modules/jsonrpcc/jsonrpc_request.c @@ -30,7 +30,6 @@ struct tm_binds tmb; -static char *shm_strdup(str *src); int memory_error() { LM_ERR("Out of memory!"); @@ -100,10 +99,10 @@ int jsonrpc_request(struct sip_msg* _m, char* _method, char* _params, char* _cb_ cb_pv = memcpy(cb_pv, (pv_spec_t *)_cb_pv, sizeof(pv_spec_t)); - cmd->method = shm_strdup(&method); - cmd->params = shm_strdup(¶ms); - cmd->cb_route = shm_strdup(&cb_route); - cmd->err_route = shm_strdup(&err_route); + cmd->method = shm_str2char_dup(&method); + cmd->params = shm_str2char_dup(¶ms); + cmd->cb_route = shm_str2char_dup(&cb_route); + cmd->err_route = shm_str2char_dup(&err_route); cmd->cb_pv = cb_pv; cmd->msg = _m; cmd->t_hash = hash_index; @@ -137,8 +136,8 @@ int jsonrpc_notification(struct sip_msg* _m, char* _method, char* _params) memset(cmd, 0, sizeof(struct jsonrpc_pipe_cmd)); - cmd->method = shm_strdup(&method); - cmd->params = shm_strdup(¶ms); + cmd->method = shm_str2char_dup(&method); + cmd->params = shm_str2char_dup(¶ms); cmd->notify_only = 1; if (write(cmd_pipe, &cmd, sizeof(cmd)) != sizeof(cmd)) { @@ -148,16 +147,3 @@ int jsonrpc_notification(struct sip_msg* _m, char* _method, char* _params) return 1; } - -static char *shm_strdup(str *src) -{ - char *res; - - if (!src || !src->s) - return NULL; - if (!(res = (char *) shm_malloc(src->len + 1))) - return NULL; - strncpy(res, src->s, src->len); - res[src->len] = 0; - return res; -}
5 years
1
0
0
0
git:master:2ffdcf7f: nat_traversal: use core string handling instead of redundant implementation
by Henning Westerholt
Module: kamailio Branch: master Commit: 2ffdcf7fa13b1450a606d135d479dbf2b8d67bd3 URL:
https://github.com/kamailio/kamailio/commit/2ffdcf7fa13b1450a606d135d479dbf…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T23:01:06+01:00 nat_traversal: use core string handling instead of redundant implementation --- Modified: src/modules/nat_traversal/nat_traversal.c --- Diff:
https://github.com/kamailio/kamailio/commit/2ffdcf7fa13b1450a606d135d479dbf…
Patch:
https://github.com/kamailio/kamailio/commit/2ffdcf7fa13b1450a606d135d479dbf…
--- diff --git a/src/modules/nat_traversal/nat_traversal.c b/src/modules/nat_traversal/nat_traversal.c index 4ad12674db..7bf0ae8c02 100644 --- a/src/modules/nat_traversal/nat_traversal.c +++ b/src/modules/nat_traversal/nat_traversal.c @@ -51,6 +51,7 @@ #include "../../core/lock_ops.h" #include "../../core/dprint.h" #include "../../core/str.h" +#include "../../core/ut.h" #include "../../core/pvar.h" #include "../../core/error.h" #include "../../core/timer.h" @@ -213,8 +214,6 @@ static bool test_private_contact(struct sip_msg *msg); static bool test_source_address(struct sip_msg *msg); static bool test_private_via(struct sip_msg *msg); -static INLINE char *shm_strdup(char *source); - static int mod_init(void); static int child_init(int rank); static void mod_destroy(void); @@ -436,7 +435,7 @@ static NAT_Contact *NAT_Contact_new(char *uri, struct socket_info *socket) } memset(contact, 0, sizeof(NAT_Contact)); - contact->uri = shm_strdup(uri); + contact->uri = shm_char_dup(uri); if(!contact->uri) { LM_ERR("out of memory while creating new NAT_Contact structure\n"); shm_free(contact); @@ -714,7 +713,7 @@ static bool Dialog_Param_add_candidate(Dialog_Param *param, char *candidate) param->callee_candidates.size = new_size; } - new_candidate = shm_strdup(candidate); + new_candidate = shm_char_dup(candidate); if(!new_candidate) { LM_ERR("cannot allocate shared memory for new candidate uri\n"); return false; @@ -759,23 +758,6 @@ static INLINE void trim(str *string) rtrim(string); } - -static INLINE char *shm_strdup(char *source) -{ - char *copy; - - if(!source) - return NULL; - - copy = (char *)shm_malloc(strlen(source) + 1); - if(!copy) - return NULL; - strcpy(copy, source); - - return copy; -} - - static bool get_contact_uri( struct sip_msg *msg, struct sip_uri *uri, contact_t **_c) { @@ -1142,7 +1124,7 @@ static void __dialog_confirmed( // free old uri in case this callback is called more than once (shouldn't normally happen) if(param->callee_uri) shm_free(param->callee_uri); - param->callee_uri = shm_strdup(callee_uri); + param->callee_uri = shm_char_dup(callee_uri); if(!param->callee_uri) { LM_ERR("cannot allocate shared memory for callee_uri in dialog " "param\n"); @@ -1277,7 +1259,7 @@ static void __dialog_created( return; uri = get_source_uri(request); - param->caller_uri = shm_strdup(uri); + param->caller_uri = shm_char_dup(uri); if(!param->caller_uri) { LM_ERR("cannot allocate shared memory for caller_uri in dialog " "param\n");
5 years
1
0
0
0
git:master:dd2167bc: janssonrpcc: use core string handling instead of redundant implementation
by Henning Westerholt
Module: kamailio Branch: master Commit: dd2167bcb35de1dd003bf4da0e03ab5dc2d50ab5 URL:
https://github.com/kamailio/kamailio/commit/dd2167bcb35de1dd003bf4da0e03ab5…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T23:00:00+01:00 janssonrpcc: use core string handling instead of redundant implementation --- Modified: src/modules/janssonrpcc/janssonrpc.h --- Diff:
https://github.com/kamailio/kamailio/commit/dd2167bcb35de1dd003bf4da0e03ab5…
Patch:
https://github.com/kamailio/kamailio/commit/dd2167bcb35de1dd003bf4da0e03ab5…
--- diff --git a/src/modules/janssonrpcc/janssonrpc.h b/src/modules/janssonrpcc/janssonrpc.h index 20b38c3fdd..3756c817e3 100644 --- a/src/modules/janssonrpcc/janssonrpc.h +++ b/src/modules/janssonrpcc/janssonrpc.h @@ -94,34 +94,14 @@ extern const str null_str; static inline str pkg_strdup(str src) { str res; - - if (!src.s) { - res.s = NULL; - res.len = 0; - } else if (!(res.s = (char *) pkg_malloc(src.len + 1))) { - res.len = 0; - } else { - strncpy(res.s, src.s, src.len); - res.s[src.len] = 0; - res.len = src.len; - } + pkg_str_dup(&src, &res); return res; } static inline str shm_strdup(str src) { str res; - - if (!src.s) { - res.s = NULL; - res.len = 0; - } else if (!(res.s = (char *) shm_malloc(src.len + 1))) { - res.len = 0; - } else { - strncpy(res.s, src.s, src.len); - res.s[src.len] = 0; - res.len = src.len; - } + shm_str_dup(&src, &res); return res; }
5 years
1
0
0
0
git:master:bf37bfc9: xmpp: use core string handling instead of redundant implementation
by Henning Westerholt
Module: kamailio Branch: master Commit: bf37bfc9186e6f75f2e5c153435a1b831a04a589 URL:
https://github.com/kamailio/kamailio/commit/bf37bfc9186e6f75f2e5c153435a1b8…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T22:58:55+01:00 xmpp: use core string handling instead of redundant implementation --- Modified: src/modules/xmpp/xmpp.c --- Diff:
https://github.com/kamailio/kamailio/commit/bf37bfc9186e6f75f2e5c153435a1b8…
Patch:
https://github.com/kamailio/kamailio/commit/bf37bfc9186e6f75f2e5c153435a1b8…
--- diff --git a/src/modules/xmpp/xmpp.c b/src/modules/xmpp/xmpp.c index d0b6869478..b2ecbfc696 100644 --- a/src/modules/xmpp/xmpp.c +++ b/src/modules/xmpp/xmpp.c @@ -323,19 +323,6 @@ int xmpp_send_sip_msg(char *from, char *to, char *msg) /*********************************************************************************/ -static char *shm_strdup(str *src) -{ - char *res; - - if (!src || !src->s) - return NULL; - if (!(res = (char *) shm_malloc(src->len + 1))) - return NULL; - strncpy(res, src->s, src->len); - res[src->len] = 0; - return res; -} - void xmpp_free_pipe_cmd(struct xmpp_pipe_cmd *cmd) { if (cmd->from) @@ -359,10 +346,10 @@ static int xmpp_send_pipe_cmd(enum xmpp_pipe_cmd_type type, str *from, str *to, memset(cmd, 0, sizeof(struct xmpp_pipe_cmd)); cmd->type = type; - cmd->from = shm_strdup(from); - cmd->to = shm_strdup(to); - cmd->body = shm_strdup(body); - cmd->id = shm_strdup(id); + cmd->from = shm_str2char_dup(from); + cmd->to = shm_str2char_dup(to); + cmd->body = shm_str2char_dup(body); + cmd->id = shm_str2char_dup(id); if (write(pipe_fds[1], &cmd, sizeof(cmd)) != sizeof(cmd)) { LM_ERR("failed to write to command pipe: %s\n", strerror(errno));
5 years
1
0
0
0
git:master:dcc80141: xmpp: use SHM_MEM_ERROR logging helper
by Henning Westerholt
Module: kamailio Branch: master Commit: dcc801412a1c3a7a619aa0f91f098a88a01502de URL:
https://github.com/kamailio/kamailio/commit/dcc801412a1c3a7a619aa0f91f098a8…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T22:58:27+01:00 xmpp: use SHM_MEM_ERROR logging helper --- Modified: src/modules/xmpp/xmpp_api.c --- Diff:
https://github.com/kamailio/kamailio/commit/dcc801412a1c3a7a619aa0f91f098a8…
Patch:
https://github.com/kamailio/kamailio/commit/dcc801412a1c3a7a619aa0f91f098a8…
--- diff --git a/src/modules/xmpp/xmpp_api.c b/src/modules/xmpp/xmpp_api.c index a078e2be7f..295385bbc2 100644 --- a/src/modules/xmpp/xmpp_api.c +++ b/src/modules/xmpp/xmpp_api.c @@ -43,7 +43,7 @@ int init_xmpp_cb_list(void) { _xmpp_cb_list = (xmpp_cb_list_t*)shm_malloc(sizeof(xmpp_cb_list_t)); if (_xmpp_cb_list==0) { - LM_CRIT("no more shared memory\n"); + SHM_MEM_ERROR; return -1; } memset(_xmpp_cb_list, 0, sizeof(xmpp_cb_list_t)); @@ -91,7 +91,7 @@ int register_xmpp_cb( int types, xmpp_cb_f f, void *param ) /* build callback structure */ if (!(it=(xmpp_callback_t*)shm_malloc(sizeof(xmpp_callback_t)))) { - LM_ERR("no more share memory\n"); + SHM_MEM_ERROR; return E_OUT_OF_MEM; }
5 years
1
0
0
0
git:master:c0aa4397: http_async_client: use core string handling instead of redundant implementation
by Henning Westerholt
Module: kamailio Branch: master Commit: c0aa4397d3c3158800d4a6af941c06b49dc21d8f URL:
https://github.com/kamailio/kamailio/commit/c0aa4397d3c3158800d4a6af941c06b…
Author: Henning Westerholt <hw(a)skalatan.de> Committer: Henning Westerholt <hw(a)skalatan.de> Date: 2019-11-23T22:55:44+01:00 http_async_client: use core string handling instead of redundant implementation --- Modified: src/modules/http_async_client/http_multi.c --- Diff:
https://github.com/kamailio/kamailio/commit/c0aa4397d3c3158800d4a6af941c06b…
Patch:
https://github.com/kamailio/kamailio/commit/c0aa4397d3c3158800d4a6af941c06b…
--- diff --git a/src/modules/http_async_client/http_multi.c b/src/modules/http_async_client/http_multi.c index 948171b519..b5c2e8d637 100644 --- a/src/modules/http_async_client/http_multi.c +++ b/src/modules/http_async_client/http_multi.c @@ -352,16 +352,9 @@ static void *curl_shm_calloc(size_t nmemb, size_t size) static char *curl_shm_strdup(const char *cp) { - char *rval; - int len; + char *p = shm_char_dup(cp); - len = strlen(cp) + 1; - rval = shm_malloc(len); - if (!rval) - return NULL; - - memcpy(rval, cp, len); - return rval; + return p; } void set_curl_mem_callbacks(void)
5 years
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
38
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
Results per page:
10
25
50
100
200