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
December 2018
----- 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
23 participants
313 discussions
Start a n
N
ew thread
git:master:304b4924: core: move includes, dprint.h from mem.h to new pkg.h, remove obselete config.h
by Henning Westerholt
Module: kamailio Branch: master Commit: 304b492425a755ab524f814d1f9e03be8f7d407a URL:
https://github.com/kamailio/kamailio/commit/304b492425a755ab524f814d1f9e03b…
Author: Henning Westerholt <hw(a)kamailio.org> Committer: Henning Westerholt <hw(a)kamailio.org> Date: 2018-12-28T18:12:58+01:00 core: move includes, dprint.h from mem.h to new pkg.h, remove obselete config.h --- Modified: src/core/mem/mem.h Modified: src/core/mem/pkg.h --- Diff:
https://github.com/kamailio/kamailio/commit/304b492425a755ab524f814d1f9e03b…
Patch:
https://github.com/kamailio/kamailio/commit/304b492425a755ab524f814d1f9e03b…
--- diff --git a/src/core/mem/mem.h b/src/core/mem/mem.h index 23aa981483..64a5a229e1 100644 --- a/src/core/mem/mem.h +++ b/src/core/mem/mem.h @@ -37,8 +37,6 @@ #ifndef mem_h #define mem_h -#include "../config.h" -#include "../dprint.h" #include "pkg.h" diff --git a/src/core/mem/pkg.h b/src/core/mem/pkg.h index f5544f5818..e231692d30 100644 --- a/src/core/mem/pkg.h +++ b/src/core/mem/pkg.h @@ -29,6 +29,8 @@ #include "memapi.h" +#include "../dprint.h" + extern sr_pkg_api_t _pkg_root; int pkg_init_api(sr_pkg_api_t *ap);
5 years, 11 months
1
0
0
0
git:master:427e47b5: core: add PKG*, SYS* and SHM* macro error helper for message and size and message
by Henning Westerholt
Module: kamailio Branch: master Commit: 427e47b500ee92cee096162b3419ef63f893cfa5 URL:
https://github.com/kamailio/kamailio/commit/427e47b500ee92cee096162b3419ef6…
Author: Henning Westerholt <hw(a)kamailio.org> Committer: Henning Westerholt <hw(a)kamailio.org> Date: 2018-12-28T17:55:36+01:00 core: add PKG*, SYS* and SHM* macro error helper for message and size and message - add more PKG_MEM_ERROR, PKG_MEM_CRITICAL, SHM_MEM_ERROR, SHM_MEM_CRITICAL, SYS_MEM_ERROR and SYS_MEM_CRITICAL error logging helper - *_MSG(m) to add an additional error string - *_SZ(s,m) to add the size of the failed allocation, additional error string --- Modified: src/core/mem/pkg.h Modified: src/core/mem/shm.h --- Diff:
https://github.com/kamailio/kamailio/commit/427e47b500ee92cee096162b3419ef6…
Patch:
https://github.com/kamailio/kamailio/commit/427e47b500ee92cee096162b3419ef6…
--- diff --git a/src/core/mem/pkg.h b/src/core/mem/pkg.h index 0222baffe0..f5544f5818 100644 --- a/src/core/mem/pkg.h +++ b/src/core/mem/pkg.h @@ -111,17 +111,36 @@ void pkg_print_manager(void); # define pkg_mod_free_stats(x) do{}while(0) #endif /*PKG_MALLOC*/ + /** generic logging helper for allocation errors in private memory pool/ system */ #ifdef SYS_MALLOC #define PKG_MEM_ERROR LM_ERR("could not allocate private memory from sys pool\n") +#define PKG_MEM_ERROR_MSG(m) LM_ERR("could not allocate private memory from sys pool - %s\n", m); +#define PKG_MEM_ERROR_SZ(s, m) LM_ERR("could not allocate private memory from sys pool, size: %u - %s\n", (unsigned int)s, m); + #define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from sys pool\n") +#define PKG_MEM_CRITICAL_MSG(m) LM_CRIT("could not allocate private memory from sys pool - %s\n", m); +#define PKG_MEM_CRITICAL_SZ(s, m) LM_CRIT("could not allocate private memory from sys pool, size: %u - %s\n", (unsigned int)s, m); + + #else #define PKG_MEM_ERROR LM_ERR("could not allocate private memory from pkg pool\n") +#define PKG_MEM_ERROR_MSG(m) LM_ERR("could not allocate private memory from pkg pool - %s\n", m); +#define PKG_MEM_ERROR_SZ(s, m) LM_ERR("could not allocate private memory from pkg pool, size: %u - %s\n", (unsigned int)s, m); + #define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from pkg pool\n") +#define PKG_MEM_CRITICAL_MSG(m) LM_CRIT("could not allocate private memory from pkg pool - %s\n", m); +#define PKG_MEM_CRITICAL_SZ(s, m) LM_CRIT("could not allocate private memory from pkg pool, size: %u - %s\n", (unsigned int)s, m); #endif + /** generic logging helper for allocation errors in system memory */ #define SYS_MEM_ERROR LM_ERR("could not allocate memory from system\n") +#define SYS_MEM_ERROR_MSG(m) LM_ERR("could not allocate memory from system - %s\n", m); +#define SYS_MEM_ERROR_SZ(s, m) LM_ERR("could not allocate memory from system, size: %u - %s\n", (unsigned int)s, m); + #define SYS_MEM_CRITICAL LM_CRIT("could not allocate memory from system\n") +#define SYS_MEM_CRITICAL_MSG(m) LM_CRIT("could not allocate memory from system - %s\n", m); +#define SYS_MEM_CRITICAL_SZ(s, m) LM_CRIT("could not allocate memory from system, size: %u - %s\n", (unsigned int)s, m); #endif diff --git a/src/core/mem/shm.h b/src/core/mem/shm.h index a726eefdb0..5da3e27664 100644 --- a/src/core/mem/shm.h +++ b/src/core/mem/shm.h @@ -98,6 +98,11 @@ int shm_address_in(void *p); /** generic logging helper for allocation errors in shared memory pool */ #define SHM_MEM_ERROR LM_ERR("could not allocate shared memory from shm pool\n") +#define SHM_MEM_ERROR_MSG(m) LM_ERR("could not allocate shared memory from shm pool - %s\n", m); +#define SHM_MEM_ERROR_SZ(s, m) LM_ERR("could not allocate shared memory from shm pool, size: %u - %s\n", (unsigned int)s, m); + #define SHM_MEM_CRITICAL LM_CRIT("could not allocate shared memory from shm pool\n") +#define SHM_MEM_CRITICAL_MSG(m) LM_CRIT("could not allocate shared memory from shm pool - %s\n", m); +#define SHM_MEM_CRITICAL_SZ(s, m) LM_CRIT("could not allocate shared memory from shm pool, size: %u - %s\n", (unsigned int)s, m); #endif
5 years, 11 months
1
0
0
0
git:master:6a36cc88: core: move PKG*, SYS* and SHM* macros to the new memory manager headers
by Henning Westerholt
Module: kamailio Branch: master Commit: 6a36cc88ce63d8a3eedd4a9e5a4bbf1e75f57934 URL:
https://github.com/kamailio/kamailio/commit/6a36cc88ce63d8a3eedd4a9e5a4bbf1…
Author: Henning Westerholt <hw(a)kamailio.org> Committer: Henning Westerholt <hw(a)kamailio.org> Date: 2018-12-28T17:37:37+01:00 core: move PKG*, SYS* and SHM* macros to the new memory manager headers --- Modified: src/core/mem/mem.h Modified: src/core/mem/pkg.h Modified: src/core/mem/shm.h --- Diff:
https://github.com/kamailio/kamailio/commit/6a36cc88ce63d8a3eedd4a9e5a4bbf1…
Patch:
https://github.com/kamailio/kamailio/commit/6a36cc88ce63d8a3eedd4a9e5a4bbf1…
--- diff --git a/src/core/mem/mem.h b/src/core/mem/mem.h index c11f891118..23aa981483 100644 --- a/src/core/mem/mem.h +++ b/src/core/mem/mem.h @@ -42,22 +42,5 @@ #include "pkg.h" - -/** generic logging helper for allocation errors in private memory pool/ system */ -#ifdef SYS_MALLOC -#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from sys pool\n") -#define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from sys pool\n") -#else -#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from pkg pool\n") -#define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from pkg pool\n") #endif -/** generic logging helper for allocation errors in system memory */ -#define SYS_MEM_ERROR LM_ERR("could not allocate memory from system\n") -#define SYS_MEM_CRITICAL LM_CRIT("could not allocate memory from system\n") - -/** generic logging helper for allocation errors in shared memory pool */ -#define SHM_MEM_ERROR LM_ERR("could not allocate shared memory from shm pool\n") -#define SHM_MEM_CRITICAL LM_CRIT("could not allocate shared memory from shm pool\n") - -#endif diff --git a/src/core/mem/pkg.h b/src/core/mem/pkg.h index 7b57719e46..0222baffe0 100644 --- a/src/core/mem/pkg.h +++ b/src/core/mem/pkg.h @@ -111,4 +111,17 @@ void pkg_print_manager(void); # define pkg_mod_free_stats(x) do{}while(0) #endif /*PKG_MALLOC*/ +/** generic logging helper for allocation errors in private memory pool/ system */ +#ifdef SYS_MALLOC +#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from sys pool\n") +#define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from sys pool\n") +#else +#define PKG_MEM_ERROR LM_ERR("could not allocate private memory from pkg pool\n") +#define PKG_MEM_CRITICAL LM_CRIT("could not allocate private memory from pkg pool\n") +#endif + +/** generic logging helper for allocation errors in system memory */ +#define SYS_MEM_ERROR LM_ERR("could not allocate memory from system\n") +#define SYS_MEM_CRITICAL LM_CRIT("could not allocate memory from system\n") + #endif diff --git a/src/core/mem/shm.h b/src/core/mem/shm.h index 4143462617..a726eefdb0 100644 --- a/src/core/mem/shm.h +++ b/src/core/mem/shm.h @@ -96,4 +96,8 @@ int shm_address_in(void *p); #define shm_available_safe() shm_available() #define shm_malloc_on_fork() do{}while(0) +/** generic logging helper for allocation errors in shared memory pool */ +#define SHM_MEM_ERROR LM_ERR("could not allocate shared memory from shm pool\n") +#define SHM_MEM_CRITICAL LM_CRIT("could not allocate shared memory from shm pool\n") + #endif
5 years, 11 months
1
0
0
0
git:master:a8de371e: auth_db: print db table name when version check fails
by Daniel-Constantin Mierla
Module: kamailio Branch: master Commit: a8de371e90ddc8a6921b5bf7464961865804cc06 URL:
https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf74649618…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com> Committer: Daniel-Constantin Mierla <miconda(a)gmail.com> Date: 2018-12-26T12:04:59+01:00 auth_db: print db table name when version check fails --- Modified: src/modules/auth_db/auth_db_mod.c --- Diff:
https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf74649618…
Patch:
https://github.com/kamailio/kamailio/commit/a8de371e90ddc8a6921b5bf74649618…
--- diff --git a/src/modules/auth_db/auth_db_mod.c b/src/modules/auth_db/auth_db_mod.c index 13fa154804..cd1ebaf8ba 100644 --- a/src/modules/auth_db/auth_db_mod.c +++ b/src/modules/auth_db/auth_db_mod.c @@ -303,7 +303,8 @@ static int auth_fixup(void** param, int param_no) if(version_table_check!=0 && db_check_table_version(&auth_dbf, dbh, &name, TABLE_VERSION) < 0) { - LM_ERR("error during table version check.\n"); + LM_ERR("error during version check for db table: %.*s.\n", + name.len, name.s); auth_dbf.close(dbh); return -1; }
5 years, 11 months
2
3
0
0
git:master:66ed074c: app_python: use mem error macros
by Victor Seva
Module: kamailio Branch: master Commit: 66ed074cc4e85dbd76483f09e6fec4ae3dc0eccb URL:
https://github.com/kamailio/kamailio/commit/66ed074cc4e85dbd76483f09e6fec4a…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2018-12-28T15:59:58+01:00 app_python: use mem error macros --- Modified: src/modules/app_python/apy_kemi.c Modified: src/modules/app_python/python_support.c --- Diff:
https://github.com/kamailio/kamailio/commit/66ed074cc4e85dbd76483f09e6fec4a…
Patch:
https://github.com/kamailio/kamailio/commit/66ed074cc4e85dbd76483f09e6fec4a…
--- diff --git a/src/modules/app_python/apy_kemi.c b/src/modules/app_python/apy_kemi.c index bcccbaa261..87e2ccce07 100644 --- a/src/modules/app_python/apy_kemi.c +++ b/src/modules/app_python/apy_kemi.c @@ -1342,7 +1342,7 @@ int apy_sr_init_mod(void) if(_sr_python_reload_version == NULL) { _sr_python_reload_version = (int*)shm_malloc(sizeof(int)); if(_sr_python_reload_version == NULL) { - LM_ERR("failed to allocated reload version\n"); + SHM_MEM_ERROR; return -1; } *_sr_python_reload_version = 0; diff --git a/src/modules/app_python/python_support.c b/src/modules/app_python/python_support.c index 7b1a93017e..7c4522eba6 100644 --- a/src/modules/app_python/python_support.c +++ b/src/modules/app_python/python_support.c @@ -94,8 +94,7 @@ void python_handle_exception(const char *fmt, ...) buf = (char *)pkg_realloc(NULL, buflen * sizeof(char)); if (!buf) { - LM_ERR("Can't allocate memory (%lu bytes), pkg_realloc() has failed." - " Not enough memory.\n", (unsigned long)(buflen * sizeof(char *))); + PKG_MEM_ERROR; if (srcbuf) pkg_free(srcbuf); return; } @@ -130,8 +129,7 @@ void python_handle_exception(const char *fmt, ...) buf = (char *)pkg_reallocxf(buf, buflen * sizeof(char)); if (!buf) { - LM_ERR("Can't allocate memory (%lu bytes), pkg_realloc() has failed." - " Not enough memory.\n", (unsigned long)(buflen * sizeof(char *))); + PKG_MEM_ERROR; Py_DECREF(line); Py_DECREF(pResult); if (srcbuf) pkg_free(srcbuf); @@ -200,8 +198,7 @@ static char *make_message(const char *fmt, va_list ap) p = (char *)pkg_realloc(NULL, size * sizeof(char)); if (!p) { - LM_ERR("Can't allocate memory (%lu bytes), pkg_malloc() has failed:" - " Not enough memory.\n", (unsigned long)(size * sizeof(char))); + PKG_MEM_ERROR; return NULL; } memset(p, 0, size * sizeof(char)); @@ -221,8 +218,7 @@ static char *make_message(const char *fmt, va_list ap) np = (char *)pkg_realloc(p, size * sizeof(char)); if (!np) { - LM_ERR("Can't allocate memory (%lu bytes), pkg_realloc() has failed:" - " Not enough memory.\n", (unsigned long)size * sizeof(char)); + PKG_MEM_ERROR; if (p) pkg_free(p); return NULL;
5 years, 11 months
1
0
0
0
git:master:bfe9fedf: app_perl: use mem error macros
by Victor Seva
Module: kamailio Branch: master Commit: bfe9fedfbf705ea6d37c5fa116f35bce6d9dfa67 URL:
https://github.com/kamailio/kamailio/commit/bfe9fedfbf705ea6d37c5fa116f35bc…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2018-12-28T15:57:27+01:00 app_perl: use mem error macros --- Modified: src/modules/app_perl/app_perl_mod.c Modified: src/modules/app_perl/kamailioxs.xs --- Diff:
https://github.com/kamailio/kamailio/commit/bfe9fedfbf705ea6d37c5fa116f35bc…
Patch:
https://github.com/kamailio/kamailio/commit/bfe9fedfbf705ea6d37c5fa116f35bc…
--- diff --git a/src/modules/app_perl/app_perl_mod.c b/src/modules/app_perl/app_perl_mod.c index d8789f919d..3852fa118c 100644 --- a/src/modules/app_perl/app_perl_mod.c +++ b/src/modules/app_perl/app_perl_mod.c @@ -217,7 +217,7 @@ PerlInterpreter *parser_init(void) { LM_INFO("setting lib path: '%s'\n", entry); argv[argc] = pkg_malloc(strlen(entry)+20); if (!argv[argc]) { - LM_ERR("not enough pkg mem\n"); + PKG_MEM_ERROR; return NULL; } sprintf(argv[argc], "-I%s", entry); @@ -329,7 +329,7 @@ static int mod_init(void) { _ap_reset_cycles = shm_malloc(sizeof(int)); if(_ap_reset_cycles == NULL) { - LM_ERR("no more shared memory\n"); + SHM_MEM_ERROR; return -1; } *_ap_reset_cycles = _ap_reset_cycles_init; diff --git a/src/modules/app_perl/kamailioxs.xs b/src/modules/app_perl/kamailioxs.xs index faaa5b1fae..8feec95b2c 100644 --- a/src/modules/app_perl/kamailioxs.xs +++ b/src/modules/app_perl/kamailioxs.xs @@ -236,7 +236,7 @@ int moduleFunc(struct sip_msg *m, char *func, if (param1) { argv[0] = (char *)pkg_malloc(strlen(param1)+1); if (!argv[0]) { - LM_ERR("not enough pkg mem\n"); + PKG_MEM_ERROR; return -1; } strcpy(argv[0], param1); @@ -248,7 +248,7 @@ int moduleFunc(struct sip_msg *m, char *func, if (param2) { argv[1] = (char *)pkg_malloc(strlen(param2)+1); if (!argv[1]) { - LM_ERR("not enough pkg mem\n"); + PKG_MEM_ERROR; if (argv[0]) pkg_free(argv[0]); return -1; }
5 years, 11 months
1
0
0
0
git:master:529a3416: app_mono: use mem error macros
by Victor Seva
Module: kamailio Branch: master Commit: 529a341609e00f55e05ec090ff99c54e5ac70a17 URL:
https://github.com/kamailio/kamailio/commit/529a341609e00f55e05ec090ff99c54…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2018-12-28T15:54:49+01:00 app_mono: use mem error macros --- Modified: src/modules/app_mono/app_mono_api.c --- Diff:
https://github.com/kamailio/kamailio/commit/529a341609e00f55e05ec090ff99c54…
Patch:
https://github.com/kamailio/kamailio/commit/529a341609e00f55e05ec090ff99c54…
--- diff --git a/src/modules/app_mono/app_mono_api.c b/src/modules/app_mono/app_mono_api.c index 05b9d151a3..efd17e8226 100644 --- a/src/modules/app_mono/app_mono_api.c +++ b/src/modules/app_mono/app_mono_api.c @@ -83,7 +83,7 @@ int sr_mono_load_script(char *script) mi = (sr_mono_load_t*)pkg_malloc(sizeof(sr_mono_load_t)); if(mi==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; return -1; } memset(mi, 0, sizeof(sr_mono_load_t)); @@ -771,7 +771,7 @@ static int sr_mono_hdr_append (MonoString *hv) hdr = (char*)pkg_malloc(txt.len+1); if(hdr==NULL) { - LM_ERR("no pkg memory left\n"); + PKG_MEM_ERROR; goto error; } memcpy(hdr, txt.s, txt.len); @@ -866,7 +866,7 @@ static int sr_mono_hdr_insert (MonoString *hv) hdr = (char*)pkg_malloc(txt.len+1); if(hdr==NULL) { - LM_ERR("no pkg memory left\n"); + PKG_MEM_ERROR; goto error; } memcpy(hdr, txt.s, txt.len);
5 years, 11 months
1
0
0
0
git:master:37c95cb4: app_lua: use mem error macros
by Victor Seva
Module: kamailio Branch: master Commit: 37c95cb4acf09daa4258003e8ddb0e0dc83c3937 URL:
https://github.com/kamailio/kamailio/commit/37c95cb4acf09daa4258003e8ddb0e0…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2018-12-28T15:50:27+01:00 app_lua: use mem error macros --- Modified: src/modules/app_lua/app_lua_api.c Modified: src/modules/app_lua/app_lua_exp.c Modified: src/modules/app_lua/app_lua_sr.c --- Diff:
https://github.com/kamailio/kamailio/commit/37c95cb4acf09daa4258003e8ddb0e0…
Patch:
https://github.com/kamailio/kamailio/commit/37c95cb4acf09daa4258003e8ddb0e0…
--- diff --git a/src/modules/app_lua/app_lua_api.c b/src/modules/app_lua/app_lua_api.c index 8fe8a22569..68e079d648 100644 --- a/src/modules/app_lua/app_lua_api.c +++ b/src/modules/app_lua/app_lua_api.c @@ -81,14 +81,14 @@ int lua_sr_alloc_script_ver(void) sr_lua_script_ver = (sr_lua_script_ver_t *) shm_malloc(sizeof(sr_lua_script_ver_t)); if(sr_lua_script_ver==NULL) { - LM_ERR("cannot allocate shm memory\n"); + SHM_MEM_ERROR; return -1; } sr_lua_script_ver->version = (unsigned int *) shm_malloc(sizeof(unsigned int)*size); if(sr_lua_script_ver->version==NULL) { - LM_ERR("cannot allocate shm memory\n"); + SHM_MEM_ERROR; goto error; } memset(sr_lua_script_ver->version, 0, sizeof(unsigned int)*size); @@ -136,7 +136,7 @@ int sr_lua_load_script(char *script) li = (sr_lua_load_t*)pkg_malloc(sizeof(sr_lua_load_t)); if(li==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; return -1; } memset(li, 0, sizeof(sr_lua_load_t)); @@ -451,7 +451,7 @@ int sr_lua_reload_script(void) _app_lua_sv = (int *) pkg_malloc(sizeof(int)*sv_len); if(_app_lua_sv==NULL) { - LM_ERR("no more pkg memory\n"); + PKG_MEM_ERROR; return -1; } } diff --git a/src/modules/app_lua/app_lua_exp.c b/src/modules/app_lua/app_lua_exp.c index 7889a4eff1..1e512ec533 100644 --- a/src/modules/app_lua/app_lua_exp.c +++ b/src/modules/app_lua/app_lua_exp.c @@ -646,7 +646,7 @@ static int lua_sr_tm_t_on_branch_failure(lua_State *L) { if ((rt_name.s = pkg_reallocxf(rt_name.s, rt_name_len+1)) == NULL) { - LM_ERR("No memory left in branch_failure fixup\n"); + PKG_MEM_ERROR; return -1; } rt_name.len = rt_name_len; diff --git a/src/modules/app_lua/app_lua_sr.c b/src/modules/app_lua/app_lua_sr.c index 8009f2970a..6119aefa46 100644 --- a/src/modules/app_lua/app_lua_sr.c +++ b/src/modules/app_lua/app_lua_sr.c @@ -171,7 +171,7 @@ static int lua_sr_modf (lua_State *L) argv[i] = (char*)pkg_malloc(strlen(luav[i])+1); if(argv[i]==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; goto error; } strcpy(argv[i], luav[i]); @@ -743,7 +743,7 @@ static int lua_sr_hdr_append (lua_State *L) hdr = (char*)pkg_malloc(len+1); if(hdr==NULL) { - LM_ERR("no pkg memory left\n"); + PKG_MEM_ERROR; return 0; } memcpy(hdr, txt, len); @@ -829,7 +829,7 @@ static int lua_sr_hdr_insert (lua_State *L) hdr = (char*)pkg_malloc(len+1); if(hdr==NULL) { - LM_ERR("no pkg memory left\n"); + PKG_MEM_ERROR; return 0; } memcpy(hdr, txt, len);
5 years, 11 months
1
0
0
0
git:master:1fdc4be9: app_jsdt: use mem error macros
by Victor Seva
Module: kamailio Branch: master Commit: 1fdc4be9541b1363081fd769ab9d863afe27a961 URL:
https://github.com/kamailio/kamailio/commit/1fdc4be9541b1363081fd769ab9d863…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2018-12-28T15:47:19+01:00 app_jsdt: use mem error macros --- Modified: src/modules/app_jsdt/app_jsdt_api.c --- Diff:
https://github.com/kamailio/kamailio/commit/1fdc4be9541b1363081fd769ab9d863…
Patch:
https://github.com/kamailio/kamailio/commit/1fdc4be9541b1363081fd769ab9d863…
--- diff --git a/src/modules/app_jsdt/app_jsdt_api.c b/src/modules/app_jsdt/app_jsdt_api.c index 907433573b..ee25fd5379 100644 --- a/src/modules/app_jsdt/app_jsdt_api.c +++ b/src/modules/app_jsdt/app_jsdt_api.c @@ -604,7 +604,7 @@ static int jsdt_sr_modf (duk_context *J) if(jsdtv[i]!=NULL) { argv[i] = (char*)pkg_malloc(strlen(jsdtv[i])+1); if(argv[i]==NULL) { - LM_ERR("no more pkg\n"); + PKG_MEM_ERROR; goto error; } strcpy(argv[i], jsdtv[i]); @@ -758,7 +758,7 @@ int jsdt_sr_init_mod(void) if(_sr_jsdt_reload_version == NULL) { _sr_jsdt_reload_version = (int*)shm_malloc(sizeof(int)); if(_sr_jsdt_reload_version == NULL) { - LM_ERR("failed to allocated reload version\n"); + SHM_MEM_ERROR; return -1; } *_sr_jsdt_reload_version = 0;
5 years, 11 months
1
0
0
0
git:master:508db5a6: app_java: use mem error macros
by Victor Seva
Module: kamailio Branch: master Commit: 508db5a6cda890c5df7c093e644f9659a1eff188 URL:
https://github.com/kamailio/kamailio/commit/508db5a6cda890c5df7c093e644f965…
Author: Victor Seva <linuxmaniac(a)torreviejawireless.org> Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org> Date: 2018-12-28T15:44:16+01:00 app_java: use mem error macros --- Modified: src/modules/app_java/app_java_mod.c Modified: src/modules/app_java/java_iface.c Modified: src/modules/app_java/java_msgobj.c Modified: src/modules/app_java/java_native_methods.c Modified: src/modules/app_java/java_sig_parser.c Modified: src/modules/app_java/utils.c --- Diff:
https://github.com/kamailio/kamailio/commit/508db5a6cda890c5df7c093e644f965…
Patch:
https://github.com/kamailio/kamailio/commit/508db5a6cda890c5df7c093e644f965…
--- diff --git a/src/modules/app_java/app_java_mod.c b/src/modules/app_java/app_java_mod.c index 393e4aa349..b789f77cf4 100644 --- a/src/modules/app_java/app_java_mod.c +++ b/src/modules/app_java/app_java_mod.c @@ -123,8 +123,7 @@ static int mod_init(void) options = (JavaVMOption *)pkg_malloc(sizeof(JavaVMOption)); if(!options) { - LM_ERR("pkg_malloc() failed: Couldn't initialize Java VM: Not enough " - "memory\n"); + PKG_MEM_ERROR; return -1; } memset(options, 0, sizeof(JavaVMOption)); diff --git a/src/modules/app_java/java_iface.c b/src/modules/app_java/java_iface.c index 0535591055..74059331ac 100644 --- a/src/modules/app_java/java_iface.c +++ b/src/modules/app_java/java_iface.c @@ -152,9 +152,7 @@ int java_exec(struct sip_msg *msgp, int is_static, int is_synchronized, + 1; // '(' + 'signature' + ')' + 'return signature' + null terminator cs = (char *)pkg_malloc((cslen+1) * sizeof(char)); if(!cs) { - LM_ERR("%s: pkg_malloc() has failed. Can't allocate %lu bytes. Not " - "enough memory!\n", - APP_NAME, (unsigned long)cslen); + PKG_MEM_ERROR; return -1; } r = snprintf(cs, cslen, "(%s)%s", signature, retval_sig); diff --git a/src/modules/app_java/java_msgobj.c b/src/modules/app_java/java_msgobj.c index cc5e1b4cce..940670f420 100644 --- a/src/modules/app_java/java_msgobj.c +++ b/src/modules/app_java/java_msgobj.c @@ -47,7 +47,7 @@ jobject *fill_sipmsg_object(JNIEnv *env, struct sip_msg *msg) SipMsgInstance = (jobject *)pkg_malloc(sizeof(jobject)); if(!SipMsgInstance) { - LM_ERR("%s: pkg_malloc() has failed. Not enough memory!\n", APP_NAME); + PKG_MEM_ERROR; return NULL; } memset(SipMsgInstance, 0, sizeof(jobject)); diff --git a/src/modules/app_java/java_native_methods.c b/src/modules/app_java/java_native_methods.c index 5d12e844cf..bb2ebe6be7 100644 --- a/src/modules/app_java/java_native_methods.c +++ b/src/modules/app_java/java_native_methods.c @@ -995,17 +995,13 @@ JNIEXPORT jint JNICALL Java_org_siprouter_CoreMethods_force_1send_1socket( nl = (struct name_lst *)pkg_malloc(sizeof(struct name_lst)); if(!nl) { - LM_ERR("%s: force_send_socket: pkg_malloc() has failed. Not enough " - "memory!\n", - APP_NAME); + PKG_MEM_ERROR; return -1; } si = (struct socket_id *)pkg_malloc(sizeof(struct socket_id)); if(!si) { - LM_ERR("%s: force_send_socket: pkg_malloc() has failed. Not enough " - "memory!\n", - APP_NAME); + PKG_MEM_ERROR; return -1; } diff --git a/src/modules/app_java/java_sig_parser.c b/src/modules/app_java/java_sig_parser.c index a1512fe85f..87b73b6288 100644 --- a/src/modules/app_java/java_sig_parser.c +++ b/src/modules/app_java/java_sig_parser.c @@ -188,7 +188,7 @@ jvalue *get_value_by_sig_type(char *sig, char *pval) ret = (jvalue *)pkg_malloc(sizeof(jvalue)); if(!ret) { - LM_ERR("%s: pkg_malloc() has failed. Not enouph memory!\n", APP_NAME); + PKG_MEM_ERROR; return NULL; } diff --git a/src/modules/app_java/utils.c b/src/modules/app_java/utils.c index 611665831e..5ec7cc17fe 100644 --- a/src/modules/app_java/utils.c +++ b/src/modules/app_java/utils.c @@ -46,7 +46,7 @@ char **split(char *str, char *sep) buf = (char **)pkg_malloc(sizeof(char *)); if(!buf) { - LM_ERR("%s: pkg_malloc() has failed. Not enough memory!\n", APP_NAME); + PKG_MEM_ERROR; return NULL; } memset(&buf, 0, sizeof(char *)); @@ -69,8 +69,7 @@ char **split(char *str, char *sep) buf = (char **)pkg_reallocxf(buf, (i + 2) * sizeof(char *)); if(!buf) { - LM_ERR("%s: pkg_realloc() has failed. Not enough memory!\n", - APP_NAME); + PKG_MEM_ERROR; return NULL; } buf[i] = strdup(token);
5 years, 11 months
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
32
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
Results per page:
10
25
50
100
200