diff options
-rw-r--r-- | CHANGES | 9 | ||||
-rw-r--r-- | channels/iax2/parser.c | 4 | ||||
-rw-r--r-- | configs/samples/asterisk.conf.sample | 9 | ||||
-rw-r--r-- | include/asterisk/alertpipe.h | 3 | ||||
-rw-r--r-- | include/asterisk/options.h | 5 | ||||
-rw-r--r-- | include/asterisk/vector.h | 23 | ||||
-rw-r--r-- | main/asterisk.c | 37 | ||||
-rw-r--r-- | main/frame.c | 19 | ||||
-rw-r--r-- | menuselect/.gitignore | 1 | ||||
-rw-r--r-- | menuselect/aclocal.m4 | 296 | ||||
-rw-r--r-- | third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch | 27 |
11 files changed, 107 insertions, 326 deletions
@@ -30,6 +30,15 @@ chan_sip --- Functionality changes from Asterisk 15.1.0 to Asterisk 15.2.0 ------------ ------------------------------------------------------------------------------ +Core +------------------ + * Added the "cache_media_frames" option to asterisk.conf. Disabling the option + helps track down media frame mismanagement when using valgrind or + MALLOC_DEBUG. The cache gets in the way of determining if the frame is + used after free and who freed it. NOTE: This option has no effect when + Asterisk is compiled with the LOW_MEMORY compile time option enabled because + the cache code does not exist. + res_rtp_asterisk ------------------ * The X.509 certificate used for DTLS negotation can now be automatically diff --git a/channels/iax2/parser.c b/channels/iax2/parser.c index ec9d34608..6eda98260 100644 --- a/channels/iax2/parser.c +++ b/channels/iax2/parser.c @@ -1296,7 +1296,9 @@ void iax_frame_free(struct iax_frame *fr) ast_atomic_fetchadd_int(&frames, -1); #if !defined(LOW_MEMORY) - if (!fr->cacheable || !(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) { + if (!fr->cacheable + || !ast_opt_cache_media_frames + || !(iax_frames = ast_threadstorage_get(&frame_cache, sizeof(*iax_frames)))) { ast_free(fr); return; } diff --git a/configs/samples/asterisk.conf.sample b/configs/samples/asterisk.conf.sample index 30934e4a9..8379b6ef0 100644 --- a/configs/samples/asterisk.conf.sample +++ b/configs/samples/asterisk.conf.sample @@ -44,6 +44,15 @@ astsbindir => /usr/sbin ;minmemfree = 1 ; In MBs, Asterisk stops accepting new calls if ; the amount of free memory falls below this ; watermark. +;cache_media_frames = yes ; Cache media frames for performance + ; Disable this option to help track down media frame + ; mismanagement when using valgrind or MALLOC_DEBUG. + ; The cache gets in the way of determining if the + ; frame is used after being freed and who freed it. + ; NOTE: This option has no effect when Asterisk is + ; compiled with the LOW_MEMORY compile time option + ; enabled because the cache code does not exist. + ; Default yes ;cache_record_files = yes ; Cache recorded sound files to another ; directory during recording. ;record_cache_dir = /tmp ; Specify cache directory (used in conjunction diff --git a/include/asterisk/alertpipe.h b/include/asterisk/alertpipe.h index 5ff854ce8..09c335829 100644 --- a/include/asterisk/alertpipe.h +++ b/include/asterisk/alertpipe.h @@ -65,7 +65,8 @@ ast_alert_status_t ast_alertpipe_read(int alert_pipe[2]); * * \param p a two-element array containing the alert pipe's file descriptors * - * \return see write(2) + * \retval 0 Success + * \retval 1 Failure */ ssize_t ast_alertpipe_write(int alert_pipe[2]); diff --git a/include/asterisk/options.h b/include/asterisk/options.h index 0a20f10a8..878748d16 100644 --- a/include/asterisk/options.h +++ b/include/asterisk/options.h @@ -66,6 +66,8 @@ enum ast_option_flags { AST_OPT_FLAG_CACHE_RECORD_FILES = (1 << 13), /*! Display timestamp in CLI verbose output */ AST_OPT_FLAG_TIMESTAMP = (1 << 14), + /*! Cache media frames for performance */ + AST_OPT_FLAG_CACHE_MEDIA_FRAMES = (1 << 15), /*! Reconnect */ AST_OPT_FLAG_RECONNECT = (1 << 16), /*! Transmit Silence during Record() and DTMF Generation */ @@ -99,7 +101,7 @@ enum ast_option_flags { }; /*! These are the options that set by default when Asterisk starts */ -#define AST_DEFAULT_OPTIONS AST_OPT_FLAG_TRANSCODE_VIA_SLIN +#define AST_DEFAULT_OPTIONS (AST_OPT_FLAG_TRANSCODE_VIA_SLIN | AST_OPT_FLAG_CACHE_MEDIA_FRAMES) #define ast_opt_exec_includes ast_test_flag(&ast_options, AST_OPT_FLAG_EXEC_INCLUDES) #define ast_opt_no_fork ast_test_flag(&ast_options, AST_OPT_FLAG_NO_FORK) @@ -116,6 +118,7 @@ enum ast_option_flags { #define ast_opt_stdexten_macro ast_test_flag(&ast_options, AST_OPT_FLAG_STDEXTEN_MACRO) #define ast_opt_dump_core ast_test_flag(&ast_options, AST_OPT_FLAG_DUMP_CORE) #define ast_opt_cache_record_files ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_RECORD_FILES) +#define ast_opt_cache_media_frames ast_test_flag(&ast_options, AST_OPT_FLAG_CACHE_MEDIA_FRAMES) #define ast_opt_timestamp ast_test_flag(&ast_options, AST_OPT_FLAG_TIMESTAMP) #define ast_opt_reconnect ast_test_flag(&ast_options, AST_OPT_FLAG_RECONNECT) #define ast_opt_transmit_silence ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE) diff --git a/include/asterisk/vector.h b/include/asterisk/vector.h index 68ce13065..8bd1cefef 100644 --- a/include/asterisk/vector.h +++ b/include/asterisk/vector.h @@ -51,6 +51,9 @@ /*! \brief Integer vector definition */ AST_VECTOR(ast_vector_int, int); +/*! \brief String vector definition */ +AST_VECTOR(ast_vector_string, char *); + /*! * \brief Define a vector structure with a read/write lock * @@ -91,6 +94,26 @@ AST_VECTOR(ast_vector_int, int); }) /*! + * \brief Steal the elements from a vector and reinitialize. + * + * \param vec Vector to operate on. + * + * This allows you to use vector.h to construct a list and use the + * data as a bare array. + * + * \note The stolen array must eventually be released using ast_free. + * + * \warning AST_VECTOR_SIZE and AST_VECTOR_MAX_SIZE are both reset + * to 0. If either are needed they must be saved to a local + * variable before stealing the elements. + */ +#define AST_VECTOR_STEAL_ELEMENTS(vec) ({ \ + typeof((vec)->elems) __elems = (vec)->elems; \ + AST_VECTOR_INIT((vec), 0); \ + (__elems); \ +}) + +/*! * \brief Initialize a vector with a read/write lock * * If \a size is 0, then no space will be allocated until the vector is diff --git a/main/asterisk.c b/main/asterisk.c index 2126487b8..77046f272 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -607,6 +607,9 @@ static char *handle_show_settings(struct ast_cli_entry *e, int cmd, struct ast_c ast_cli(a->fd, " Transmit silence during rec: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_TRANSMIT_SILENCE) ? "Enabled" : "Disabled"); ast_cli(a->fd, " Generic PLC: %s\n", ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC) ? "Enabled" : "Disabled"); ast_cli(a->fd, " Min DTMF duration:: %u\n", option_dtmfminduration); +#if !defined(LOW_MEMORY) + ast_cli(a->fd, " Cache media frames: %s\n", ast_opt_cache_media_frames ? "Enabled" : "Disabled"); +#endif ast_cli(a->fd, " RTP use dynamic payloads: %u\n", ast_option_rtpusedynamic); if (ast_option_rtpptdynamic == AST_RTP_PT_LAST_REASSIGN) { @@ -1761,15 +1764,13 @@ static struct sigaction urg_handler = { static void _hup_handler(int num) { - int a = 0, save_errno = errno; + int save_errno = errno; printf("Received HUP signal -- Reloading configs\n"); if (restartnow) execvp(_argv[0], _argv); sig_flags.need_reload = 1; - if (sig_alert_pipe[1] != -1) { - if (write(sig_alert_pipe[1], &a, sizeof(a)) < 0) { - fprintf(stderr, "hup_handler: write() failed: %s\n", strerror(errno)); - } + if (ast_alertpipe_write(sig_alert_pipe)) { + fprintf(stderr, "hup_handler: write() failed: %s\n", strerror(errno)); } errno = save_errno; } @@ -2169,10 +2170,7 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart) close(ast_consock); if (!ast_opt_remote) unlink(ast_config_AST_PID); - if (sig_alert_pipe[0]) - close(sig_alert_pipe[0]); - if (sig_alert_pipe[1]) - close(sig_alert_pipe[1]); + ast_alertpipe_close(sig_alert_pipe); printf("%s", term_quit()); if (restart) { int i; @@ -2208,12 +2206,9 @@ static void really_quit(int num, shutdown_nice_t niceness, int restart) static void __quit_handler(int num) { - int a = 0; sig_flags.need_quit = 1; - if (sig_alert_pipe[1] != -1) { - if (write(sig_alert_pipe[1], &a, sizeof(a)) < 0) { - fprintf(stderr, "quit_handler: write() failed: %s\n", strerror(errno)); - } + if (ast_alertpipe_write(sig_alert_pipe)) { + fprintf(stderr, "quit_handler: write() failed: %s\n", strerror(errno)); } /* There is no need to restore the signal handler here, since the app * is going to exit */ @@ -3717,6 +3712,11 @@ static void ast_readconfig(void) /* Cache recorded sound files to another directory during recording */ } else if (!strcasecmp(v->name, "cache_record_files")) { ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_CACHE_RECORD_FILES); +#if !defined(LOW_MEMORY) + /* Cache media frames for performance */ + } else if (!strcasecmp(v->name, "cache_media_frames")) { + ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_CACHE_MEDIA_FRAMES); +#endif /* Specify cache directory */ } else if (!strcasecmp(v->name, "record_cache_dir")) { ast_copy_string(record_cache_dir, v->value, AST_CACHE_DIR_LEN); @@ -3880,7 +3880,7 @@ static void *monitor_sig_flags(void *unused) { for (;;) { struct pollfd p = { sig_alert_pipe[0], POLLIN, 0 }; - int a; + ast_poll(&p, 1, -1); if (sig_flags.need_reload) { sig_flags.need_reload = 0; @@ -3895,8 +3895,7 @@ static void *monitor_sig_flags(void *unused) quit_handler(0, SHUTDOWN_NORMAL, 0); } } - if (read(sig_alert_pipe[0], &a, sizeof(a)) != sizeof(a)) { - } + ast_alertpipe_read(sig_alert_pipe); } return NULL; @@ -4703,9 +4702,7 @@ static void asterisk_daemon(int isroot, const char *runuser, const char *rungrou consolethread = pthread_self(); } - if (pipe(sig_alert_pipe)) { - sig_alert_pipe[0] = sig_alert_pipe[1] = -1; - } + ast_alertpipe_init(sig_alert_pipe); ast_process_pending_reloads(); diff --git a/main/frame.c b/main/frame.c index 8a151eff8..dd47f42d0 100644 --- a/main/frame.c +++ b/main/frame.c @@ -120,14 +120,18 @@ static void __frame_free(struct ast_frame *fr, int cache) return; #if !defined(LOW_MEMORY) - if (cache && fr->mallocd == AST_MALLOCD_HDR) { + if (fr->mallocd == AST_MALLOCD_HDR + && cache + && ast_opt_cache_media_frames) { /* Cool, only the header is malloc'd, let's just cache those for now * to keep things simple... */ struct ast_frame_cache *frames; - if ((frames = ast_threadstorage_get(&frame_cache, sizeof(*frames))) && - (frames->size < FRAME_CACHE_MAX_SIZE)) { - if ((fr->frametype == AST_FRAME_VOICE) || (fr->frametype == AST_FRAME_VIDEO) || - (fr->frametype == AST_FRAME_IMAGE)) { + + frames = ast_threadstorage_get(&frame_cache, sizeof(*frames)); + if (frames && frames->size < FRAME_CACHE_MAX_SIZE) { + if (fr->frametype == AST_FRAME_VOICE + || fr->frametype == AST_FRAME_VIDEO + || fr->frametype == AST_FRAME_IMAGE) { ao2_cleanup(fr->subclass.format); } @@ -147,8 +151,9 @@ static void __frame_free(struct ast_frame *fr, int cache) ast_free((void *) fr->src); } if (fr->mallocd & AST_MALLOCD_HDR) { - if ((fr->frametype == AST_FRAME_VOICE) || (fr->frametype == AST_FRAME_VIDEO) || - (fr->frametype == AST_FRAME_IMAGE)) { + if (fr->frametype == AST_FRAME_VOICE + || fr->frametype == AST_FRAME_VIDEO + || fr->frametype == AST_FRAME_IMAGE) { ao2_cleanup(fr->subclass.format); } diff --git a/menuselect/.gitignore b/menuselect/.gitignore index ded8d2d6e..05f4778ff 100644 --- a/menuselect/.gitignore +++ b/menuselect/.gitignore @@ -1,3 +1,4 @@ +aclocal.m4 autoconfig.h cmenuselect config.log diff --git a/menuselect/aclocal.m4 b/menuselect/aclocal.m4 deleted file mode 100644 index e67774c06..000000000 --- a/menuselect/aclocal.m4 +++ /dev/null @@ -1,296 +0,0 @@ -# generated automatically by aclocal 1.15 -*- Autoconf -*- - -# Copyright (C) 1996-2014 Free Software Foundation, Inc. - -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) -dnl -dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. -dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> -dnl -dnl This program is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl This program is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with this program; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -dnl 02111-1307, USA. -dnl -dnl As a special exception to the GNU General Public License, if you -dnl distribute this file as part of a program that contains a -dnl configuration script generated by Autoconf, you may include it under -dnl the same distribution terms that you use for the rest of that -dnl program. - -dnl PKG_PREREQ(MIN-VERSION) -dnl ----------------------- -dnl Since: 0.29 -dnl -dnl Verify that the version of the pkg-config macros are at least -dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's -dnl installed version of pkg-config, this checks the developer's version -dnl of pkg.m4 when generating configure. -dnl -dnl To ensure that this macro is defined, also add: -dnl m4_ifndef([PKG_PREREQ], -dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) -dnl -dnl See the "Since" comment for each macro you use to see what version -dnl of the macros you require. -m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) -m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, - [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) -])dnl PKG_PREREQ - -dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) -dnl ---------------------------------- -dnl Since: 0.16 -dnl -dnl Search for the pkg-config tool and set the PKG_CONFIG variable to -dnl first found in the path. Checks that the version of pkg-config found -dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is -dnl used since that's the first version where most current features of -dnl pkg-config existed. -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) -m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) -AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) -AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi -fi[]dnl -])dnl PKG_PROG_PKG_CONFIG - -dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------------------------------- -dnl Since: 0.18 -dnl -dnl Check to see whether a particular set of modules exists. Similar to -dnl PKG_CHECK_MODULES(), but does not set variables or print errors. -dnl -dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -dnl only at the first occurence in configure.ac, so if the first place -dnl it's called might be skipped (such as if it is within an "if", you -dnl have to call PKG_CHECK_EXISTS manually -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_default([$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - -dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -dnl --------------------------------------------- -dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting -dnl pkg_failed based on the result. -m4_define([_PKG_CONFIG], -[if test -n "$$1"; then - pkg_cv_[]$1="$$1" - elif test -n "$PKG_CONFIG"; then - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes ], - [pkg_failed=yes]) - else - pkg_failed=untried -fi[]dnl -])dnl _PKG_CONFIG - -dnl _PKG_SHORT_ERRORS_SUPPORTED -dnl --------------------------- -dnl Internal check to see if pkg-config supports short errors. -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])dnl _PKG_SHORT_ERRORS_SUPPORTED - - -dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl -------------------------------------------------------------- -dnl Since: 0.4.0 -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES might not happen, you should be sure to include an -dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - AC_MSG_RESULT([no]) - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - m4_default([$4], [AC_MSG_ERROR( -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT])[]dnl - ]) -elif test $pkg_failed = untried; then - AC_MSG_RESULT([no]) - m4_default([$4], [AC_MSG_FAILURE( -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl - ]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - $3 -fi[]dnl -])dnl PKG_CHECK_MODULES - - -dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -dnl [ACTION-IF-NOT-FOUND]) -dnl --------------------------------------------------------------------- -dnl Since: 0.29 -dnl -dnl Checks for existence of MODULES and gathers its build flags with -dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags -dnl and VARIABLE-PREFIX_LIBS from --libs. -dnl -dnl Note that if there is a possibility the first call to -dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to -dnl include an explicit call to PKG_PROG_PKG_CONFIG in your -dnl configure.ac. -AC_DEFUN([PKG_CHECK_MODULES_STATIC], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -_save_PKG_CONFIG=$PKG_CONFIG -PKG_CONFIG="$PKG_CONFIG --static" -PKG_CHECK_MODULES($@) -PKG_CONFIG=$_save_PKG_CONFIG[]dnl -])dnl PKG_CHECK_MODULES_STATIC - - -dnl PKG_INSTALLDIR([DIRECTORY]) -dnl ------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable pkgconfigdir as the location where a module -dnl should install pkg-config .pc files. By default the directory is -dnl $libdir/pkgconfig, but the default can be changed by passing -dnl DIRECTORY. The user can override through the --with-pkgconfigdir -dnl parameter. -AC_DEFUN([PKG_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([pkgconfigdir], - [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, - [with_pkgconfigdir=]pkg_default) -AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_INSTALLDIR - - -dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) -dnl -------------------------------- -dnl Since: 0.27 -dnl -dnl Substitutes the variable noarch_pkgconfigdir as the location where a -dnl module should install arch-independent pkg-config .pc files. By -dnl default the directory is $datadir/pkgconfig, but the default can be -dnl changed by passing DIRECTORY. The user can override through the -dnl --with-noarch-pkgconfigdir parameter. -AC_DEFUN([PKG_NOARCH_INSTALLDIR], -[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) -m4_pushdef([pkg_description], - [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) -AC_ARG_WITH([noarch-pkgconfigdir], - [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, - [with_noarch_pkgconfigdir=]pkg_default) -AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) -m4_popdef([pkg_default]) -m4_popdef([pkg_description]) -])dnl PKG_NOARCH_INSTALLDIR - - -dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, -dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -dnl ------------------------------------------- -dnl Since: 0.28 -dnl -dnl Retrieves the value of the pkg-config variable for the given module. -AC_DEFUN([PKG_CHECK_VAR], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl - -_PKG_CONFIG([$1], [variable="][$3]["], [$2]) -AS_VAR_COPY([$1], [pkg_cv_][$1]) - -AS_VAR_IF([$1], [""], [$5], [$4])dnl -])dnl PKG_CHECK_VAR - -m4_include([../autoconf/ast_check_gnu_make.m4]) -m4_include([../autoconf/ast_ext_lib.m4]) -m4_include([../autoconf/ast_ext_tool_check.m4]) -m4_include([../autoconf/ast_gcc_attribute.m4]) -m4_include([../autoconf/ast_pkgconfig.m4]) -m4_include([../autoconf/ast_prog_sed.m4]) diff --git a/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch b/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch new file mode 100644 index 000000000..e42b0f7c6 --- /dev/null +++ b/third-party/pjproject/patches/0030-sip_transport-Destroy-transports-not-in-hash.patch @@ -0,0 +1,27 @@ +diff --git a/pjsip/src/pjsip/sip_transport.c b/pjsip/src/pjsip/sip_transport.c +index e4bec24..a39b56e 100644 +--- a/pjsip/src/pjsip/sip_transport.c ++++ b/pjsip/src/pjsip/sip_transport.c +@@ -957,7 +957,21 @@ static pj_bool_t is_transport_valid(pjsip_tpmgr *tpmgr, pjsip_transport *tp, + const pjsip_transport_key *key, + int key_len) + { +- return (pj_hash_get(tpmgr->table, key, key_len, NULL) == (void*)tp); ++ transport *tp_iter; ++ ++ if (pj_hash_get(tpmgr->table, key, key_len, NULL) == (void*)tp) { ++ return PJ_TRUE; ++ } ++ ++ tp_iter = tpmgr->tp_list.next; ++ while (tp_iter != &tpmgr->tp_list) { ++ if (tp_iter->tp == tp) { ++ return PJ_TRUE; ++ } ++ tp_iter = tp_iter->next; ++ } ++ ++ return PJ_FALSE; + } + + /* |