Re #1900: Merged changes from trunk.
git-svn-id: https://svn.pjsip.org/repos/pjproject/branches/projects/uwp@5538 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
commit
1b25ccaf76
74
aconfigure
74
aconfigure
|
@ -755,7 +755,6 @@ infodir
|
|||
docdir
|
||||
oldincludedir
|
||||
includedir
|
||||
runstatedir
|
||||
localstatedir
|
||||
sharedstatedir
|
||||
sysconfdir
|
||||
|
@ -878,7 +877,6 @@ datadir='${datarootdir}'
|
|||
sysconfdir='${prefix}/etc'
|
||||
sharedstatedir='${prefix}/com'
|
||||
localstatedir='${prefix}/var'
|
||||
runstatedir='${localstatedir}/run'
|
||||
includedir='${prefix}/include'
|
||||
oldincludedir='/usr/include'
|
||||
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
|
||||
|
@ -1131,15 +1129,6 @@ do
|
|||
| -silent | --silent | --silen | --sile | --sil)
|
||||
silent=yes ;;
|
||||
|
||||
-runstatedir | --runstatedir | --runstatedi | --runstated \
|
||||
| --runstate | --runstat | --runsta | --runst | --runs \
|
||||
| --run | --ru | --r)
|
||||
ac_prev=runstatedir ;;
|
||||
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
||||
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
||||
| --run=* | --ru=* | --r=*)
|
||||
runstatedir=$ac_optarg ;;
|
||||
|
||||
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
||||
ac_prev=sbindir ;;
|
||||
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
||||
|
@ -1277,7 +1266,7 @@ fi
|
|||
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
||||
datadir sysconfdir sharedstatedir localstatedir includedir \
|
||||
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
||||
libdir localedir mandir runstatedir
|
||||
libdir localedir mandir
|
||||
do
|
||||
eval ac_val=\$$ac_var
|
||||
# Remove trailing slashes.
|
||||
|
@ -1430,7 +1419,6 @@ Fine tuning of the installation directories:
|
|||
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
||||
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
||||
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
||||
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
||||
--libdir=DIR object code libraries [EPREFIX/lib]
|
||||
--includedir=DIR C header files [PREFIX/include]
|
||||
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
||||
|
@ -7865,9 +7853,9 @@ if test "x$ac_cv_lib_crypto_ERR_load_BIO_strings" = xyes; then :
|
|||
libcrypto_present=1 && LIBS="-lcrypto $LIBS"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_library_init in -lssl" >&5
|
||||
$as_echo_n "checking for SSL_library_init in -lssl... " >&6; }
|
||||
if ${ac_cv_lib_ssl_SSL_library_init+:} false; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSL_CTX_new in -lssl" >&5
|
||||
$as_echo_n "checking for SSL_CTX_new in -lssl... " >&6; }
|
||||
if ${ac_cv_lib_ssl_SSL_CTX_new+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
|
@ -7881,27 +7869,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char SSL_library_init ();
|
||||
char SSL_CTX_new ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return SSL_library_init ();
|
||||
return SSL_CTX_new ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_ssl_SSL_library_init=yes
|
||||
ac_cv_lib_ssl_SSL_CTX_new=yes
|
||||
else
|
||||
ac_cv_lib_ssl_SSL_library_init=no
|
||||
ac_cv_lib_ssl_SSL_CTX_new=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_library_init" >&5
|
||||
$as_echo "$ac_cv_lib_ssl_SSL_library_init" >&6; }
|
||||
if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_SSL_CTX_new" >&5
|
||||
$as_echo "$ac_cv_lib_ssl_SSL_CTX_new" >&6; }
|
||||
if test "x$ac_cv_lib_ssl_SSL_CTX_new" = xyes; then :
|
||||
libssl_present=1 && LIBS="-lssl $LIBS"
|
||||
fi
|
||||
|
||||
|
@ -7910,47 +7898,25 @@ fi
|
|||
$as_echo "OpenSSL library found, SSL support enabled" >&6; }
|
||||
|
||||
# Check if SRTP should be compiled with OpenSSL
|
||||
# support, to enable cryptos such as AES GCM
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_aes_128_gcm in -lcrypto" >&5
|
||||
$as_echo_n "checking for EVP_aes_128_gcm in -lcrypto... " >&6; }
|
||||
if ${ac_cv_lib_crypto_EVP_aes_128_gcm+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-lcrypto $LIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
# support, to enable cryptos such as AES GCM.
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char EVP_aes_128_gcm ();
|
||||
# EVP_CIPHER_CTX is now opaque in OpenSSL 1.1.0, libsrtp 1.5.4 uses it as a transparent type.
|
||||
# AC_CHECK_LIB(crypto,EVP_aes_128_gcm,[ac_ssl_has_aes_gcm=1])
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <openssl/evp.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return EVP_aes_128_gcm ();
|
||||
EVP_CIPHER_CTX ctx;EVP_aes_128_gcm();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
ac_cv_lib_crypto_EVP_aes_128_gcm=yes
|
||||
else
|
||||
ac_cv_lib_crypto_EVP_aes_128_gcm=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_aes_128_gcm" >&5
|
||||
$as_echo "$ac_cv_lib_crypto_EVP_aes_128_gcm" >&6; }
|
||||
if test "x$ac_cv_lib_crypto_EVP_aes_128_gcm" = xyes; then :
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_ssl_has_aes_gcm=1
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
if test "x$ac_ssl_has_aes_gcm" = "x1"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenSSL has AES GCM support, SRTP will use OpenSSL" >&5
|
||||
$as_echo "OpenSSL has AES GCM support, SRTP will use OpenSSL" >&6; }
|
||||
|
|
|
@ -1555,13 +1555,18 @@ AC_ARG_ENABLE(ssl,
|
|||
AC_SUBST(libcrypto_present)
|
||||
AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1])
|
||||
AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="-lcrypto $LIBS"])
|
||||
AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="-lssl $LIBS"])
|
||||
AC_CHECK_LIB(ssl,SSL_CTX_new,[libssl_present=1 && LIBS="-lssl $LIBS"])
|
||||
if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
|
||||
AC_MSG_RESULT([OpenSSL library found, SSL support enabled])
|
||||
|
||||
# Check if SRTP should be compiled with OpenSSL
|
||||
# support, to enable cryptos such as AES GCM
|
||||
AC_CHECK_LIB(crypto,EVP_aes_128_gcm,[ac_ssl_has_aes_gcm=1])
|
||||
# support, to enable cryptos such as AES GCM.
|
||||
|
||||
# EVP_CIPHER_CTX is now opaque in OpenSSL 1.1.0, libsrtp 1.5.4 uses it as a transparent type.
|
||||
# AC_CHECK_LIB(crypto,EVP_aes_128_gcm,[ac_ssl_has_aes_gcm=1])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <openssl/evp.h>]],
|
||||
[EVP_CIPHER_CTX ctx;EVP_aes_128_gcm();])],
|
||||
[ac_ssl_has_aes_gcm=1])
|
||||
if test "x$ac_ssl_has_aes_gcm" = "x1"; then
|
||||
AC_MSG_RESULT([OpenSSL has AES GCM support, SRTP will use OpenSSL])
|
||||
else
|
||||
|
|
|
@ -710,6 +710,7 @@ static int a_parser_test(void)
|
|||
|
||||
rc = pj_dns_parse_a_response(&pkt, &rec);
|
||||
pj_assert(rc == PJLIB_UTIL_EDNSNOANSWERREC);
|
||||
PJ_UNUSED_ARG(rc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -919,6 +920,7 @@ static int addr_parser_test(void)
|
|||
|
||||
rc = pj_dns_parse_addr_response(&pkt, &rec);
|
||||
pj_assert(rc == PJLIB_UTIL_EDNSNOANSWERREC);
|
||||
PJ_UNUSED_ARG(rc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1468,7 +1470,7 @@ static int srv_resolver_test(void)
|
|||
pj_sem_wait(sem);
|
||||
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1838,7 +1840,7 @@ static int srv_resolver_many_test(void)
|
|||
|
||||
pj_sem_wait(sem);
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -124,11 +124,7 @@ PJ_DEF(pj_status_t) pj_dns_server_destroy(pj_dns_server *srv)
|
|||
srv->asock = NULL;
|
||||
}
|
||||
|
||||
if (srv->pool) {
|
||||
pj_pool_t *pool = srv->pool;
|
||||
srv->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&srv->pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -184,5 +184,5 @@ PJ_DEF(pj_status_t) pjlib_util_init(void)
|
|||
&pjlib_util_strerror);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -513,11 +513,8 @@ PJ_DEF(pj_status_t) pj_dns_resolver_destroy( pj_dns_resolver *resolver,
|
|||
resolver->mutex = NULL;
|
||||
}
|
||||
|
||||
if (resolver->pool) {
|
||||
pj_pool_t *pool = resolver->pool;
|
||||
resolver->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&resolver->pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -652,6 +652,7 @@ static void dns_callback(void *user_data,
|
|||
|
||||
} else if (query_job->dns_state == PJ_DNS_TYPE_A) {
|
||||
pj_bool_t is_type_a, srv_completed;
|
||||
pj_dns_addr_record rec;
|
||||
|
||||
/* Clear outstanding job */
|
||||
if (common->type == PJ_DNS_TYPE_A) {
|
||||
|
@ -668,15 +669,26 @@ static void dns_callback(void *user_data,
|
|||
|
||||
is_type_a = (common->type == PJ_DNS_TYPE_A);
|
||||
|
||||
/* Parse response */
|
||||
if (status==PJ_SUCCESS && pkt->hdr.anscount != 0) {
|
||||
status = pj_dns_parse_addr_response(pkt, &rec);
|
||||
if (status!=PJ_SUCCESS) {
|
||||
char errmsg[PJ_ERR_MSG_SIZE];
|
||||
|
||||
PJ_LOG(4,(query_job->objname,
|
||||
"DNS %s record parse error for '%.*s'."
|
||||
" Err=%d (%s)",
|
||||
(is_type_a ? "A" : "AAAA"),
|
||||
(int)query_job->domain_part.slen,
|
||||
query_job->domain_part.ptr,
|
||||
status,
|
||||
pj_strerror(status,errmsg,sizeof(errmsg)).ptr));
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that we really have answer */
|
||||
if (status==PJ_SUCCESS && pkt->hdr.anscount != 0) {
|
||||
char addr[PJ_INET6_ADDRSTRLEN];
|
||||
pj_dns_addr_record rec;
|
||||
|
||||
/* Parse response */
|
||||
status = pj_dns_parse_addr_response(pkt, &rec);
|
||||
if (status != PJ_SUCCESS)
|
||||
goto on_error;
|
||||
|
||||
pj_assert(rec.addr_count != 0);
|
||||
|
||||
|
|
|
@ -390,6 +390,15 @@ PJ_IDECL(pj_pool_t*) pj_pool_create(pj_pool_factory *factory,
|
|||
*/
|
||||
PJ_IDECL(void) pj_pool_release( pj_pool_t *pool );
|
||||
|
||||
|
||||
/**
|
||||
* Release the pool back to pool factory and set the pool pointer to zero.
|
||||
*
|
||||
* @param ppool Pointer to memory pool.
|
||||
*/
|
||||
PJ_IDECL(void) pj_pool_safe_release( pj_pool_t **ppool );
|
||||
|
||||
|
||||
/**
|
||||
* Get pool object name.
|
||||
*
|
||||
|
|
|
@ -92,3 +92,11 @@ PJ_IDEF(void) pj_pool_release( pj_pool_t *pool )
|
|||
(*pool->factory->release_pool)(pool->factory, pool);
|
||||
}
|
||||
|
||||
|
||||
PJ_IDEF(void) pj_pool_safe_release( pj_pool_t **ppool )
|
||||
{
|
||||
pj_pool_t *pool = *ppool;
|
||||
*ppool = NULL;
|
||||
if (pool)
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
/*
|
||||
* Include OpenSSL headers
|
||||
*/
|
||||
#include <openssl/asn1.h>
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
|
@ -110,9 +111,21 @@ static unsigned get_nid_from_cid(unsigned cid)
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
# define OPENSSL_NO_SSL2 /* seems to be removed in 1.1.0 */
|
||||
# define M_ASN1_STRING_data(x) ASN1_STRING_get0_data(x)
|
||||
# define M_ASN1_STRING_length(x) ASN1_STRING_length(x)
|
||||
#else
|
||||
# define SSL_CIPHER_get_id(c) (c)->id
|
||||
# define SSL_set_session(ssl, s) (ssl)->session = (s)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma comment( lib, "libeay32")
|
||||
# pragma comment( lib, "ssleay32")
|
||||
# pragma comment( lib, "crypt32")
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -431,12 +444,13 @@ static pj_status_t init_openssl(void)
|
|||
const SSL_CIPHER *c;
|
||||
c = sk_SSL_CIPHER_value(sk_cipher,i);
|
||||
openssl_ciphers[i].id = (pj_ssl_cipher)
|
||||
(pj_uint32_t)c->id & 0x00FFFFFF;
|
||||
(pj_uint32_t)SSL_CIPHER_get_id(c) &
|
||||
0x00FFFFFF;
|
||||
openssl_ciphers[i].name = SSL_CIPHER_get_name(c);
|
||||
}
|
||||
openssl_cipher_num = n;
|
||||
|
||||
ssl->session = SSL_SESSION_new();
|
||||
SSL_set_session(ssl, SSL_SESSION_new());
|
||||
|
||||
#if !defined(OPENSSL_NO_EC) && OPENSSL_VERSION_NUMBER >= 0x1000200fL
|
||||
openssl_curves_num = SSL_get_shared_curve(ssl,-1);
|
||||
|
@ -1013,7 +1027,8 @@ static pj_status_t set_cipher_list(pj_ssl_sock_t *ssock)
|
|||
const SSL_CIPHER *c;
|
||||
c = sk_SSL_CIPHER_value(sk_cipher, j);
|
||||
if (ssock->param.ciphers[i] == (pj_ssl_cipher)
|
||||
((pj_uint32_t)c->id & 0x00FFFFFF))
|
||||
((pj_uint32_t)SSL_CIPHER_get_id(c) &
|
||||
0x00FFFFFF))
|
||||
{
|
||||
const char *c_name;
|
||||
|
||||
|
@ -1066,7 +1081,7 @@ static pj_status_t set_curves_list(pj_ssl_sock_t *ssock)
|
|||
curves[cnt] = get_nid_from_cid(ssock->param.curves[cnt]);
|
||||
}
|
||||
|
||||
if( ssock->ossl_ssl->server ) {
|
||||
if( SSL_is_server(ssock->ossl_ssl) ) {
|
||||
ret = SSL_set1_curves(ssock->ossl_ssl, curves,
|
||||
ssock->param.curves_num);
|
||||
if (ret < 1)
|
||||
|
@ -1225,7 +1240,7 @@ static void get_cert_info(pj_pool_t *pool, pj_ssl_cert_info *ci, X509 *x,
|
|||
pj_bool_t update_needed;
|
||||
char buf[512];
|
||||
pj_uint8_t serial_no[64] = {0}; /* should be >= sizeof(ci->serial_no) */
|
||||
pj_uint8_t *q;
|
||||
const pj_uint8_t *q;
|
||||
unsigned len;
|
||||
GENERAL_NAMES *names = NULL;
|
||||
|
||||
|
@ -1235,7 +1250,7 @@ static void get_cert_info(pj_pool_t *pool, pj_ssl_cert_info *ci, X509 *x,
|
|||
X509_NAME_oneline(X509_get_issuer_name(x), buf, sizeof(buf));
|
||||
|
||||
/* Get serial no */
|
||||
q = (pj_uint8_t*) M_ASN1_STRING_data(X509_get_serialNumber(x));
|
||||
q = (const pj_uint8_t*) M_ASN1_STRING_data(X509_get_serialNumber(x));
|
||||
len = M_ASN1_STRING_length(X509_get_serialNumber(x));
|
||||
if (len > sizeof(ci->serial_no))
|
||||
len = sizeof(ci->serial_no);
|
||||
|
@ -2642,7 +2657,7 @@ PJ_DEF(pj_status_t) pj_ssl_sock_get_info (pj_ssl_sock_t *ssock,
|
|||
|
||||
/* Current cipher */
|
||||
cipher = SSL_get_current_cipher(ssock->ossl_ssl);
|
||||
info->cipher = (cipher->id & 0x00FFFFFF);
|
||||
info->cipher = (SSL_CIPHER_get_id(cipher) & 0x00FFFFFF);
|
||||
|
||||
/* Remote address */
|
||||
pj_sockaddr_cp(&info->remote_addr, &ssock->rem_addr);
|
||||
|
|
|
@ -141,9 +141,7 @@ static pj_status_t factory_destroy(pjmedia_aud_dev_factory *f)
|
|||
status = pjmedia_snd_deinit();
|
||||
|
||||
if (status == PJ_SUCCESS) {
|
||||
pj_pool_t *pool = wf->pool;
|
||||
wf->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&wf->pool);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
@ -455,10 +453,7 @@ static pj_status_t stream_destroy(pjmedia_aud_stream *s)
|
|||
status = pjmedia_snd_stream_close(strm->snd_strm);
|
||||
|
||||
if (status == PJ_SUCCESS) {
|
||||
pj_pool_t *pool = strm->pool;
|
||||
|
||||
strm->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&strm->pool);
|
||||
}
|
||||
|
||||
return status;
|
||||
|
|
|
@ -160,10 +160,8 @@ static pj_status_t null_factory_init(pjmedia_aud_dev_factory *f)
|
|||
static pj_status_t null_factory_destroy(pjmedia_aud_dev_factory *f)
|
||||
{
|
||||
struct null_audio_factory *nf = (struct null_audio_factory*)f;
|
||||
pj_pool_t *pool = nf->pool;
|
||||
|
||||
nf->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&nf->pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -192,10 +192,8 @@ static pj_status_t avi_factory_init(pjmedia_vid_dev_factory *f)
|
|||
static pj_status_t avi_factory_destroy(pjmedia_vid_dev_factory *f)
|
||||
{
|
||||
struct avi_factory *cf = (struct avi_factory*)f;
|
||||
pj_pool_t *pool = cf->pool;
|
||||
|
||||
cf->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&cf->pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -252,10 +252,8 @@ static pj_status_t cbar_factory_init(pjmedia_vid_dev_factory *f)
|
|||
static pj_status_t cbar_factory_destroy(pjmedia_vid_dev_factory *f)
|
||||
{
|
||||
struct cbar_factory *cf = (struct cbar_factory*)f;
|
||||
pj_pool_t *pool = cf->pool;
|
||||
|
||||
cf->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&cf->pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -415,11 +415,8 @@ PJ_DEF(pj_status_t) pjmedia_clock_destroy(pjmedia_clock *clock)
|
|||
clock->lock = NULL;
|
||||
}
|
||||
|
||||
if (clock->pool) {
|
||||
pj_pool_t *pool = clock->pool;
|
||||
clock->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&clock->pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -2571,11 +2571,8 @@ PJ_DEF(pj_status_t) pjmedia_stream_destroy( pjmedia_stream *stream )
|
|||
}
|
||||
#endif
|
||||
|
||||
if (stream->own_pool) {
|
||||
pj_pool_t *pool = stream->own_pool;
|
||||
stream->own_pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&stream->own_pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1878,11 +1878,7 @@ static pj_status_t transport_destroy(pjmedia_transport *tp)
|
|||
tp_ice->ice_st = NULL;
|
||||
}
|
||||
|
||||
if (tp_ice->pool) {
|
||||
pj_pool_t *pool = tp_ice->pool;
|
||||
tp_ice->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&tp_ice->pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -1804,11 +1804,7 @@ PJ_DEF(pj_status_t) pjmedia_vid_stream_destroy( pjmedia_vid_stream *stream )
|
|||
}
|
||||
#endif
|
||||
|
||||
if (stream->own_pool) {
|
||||
pj_pool_t *pool = stream->own_pool;
|
||||
stream->own_pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&stream->own_pool);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -715,7 +715,7 @@ static pj_status_t codec_put_frame(struct pjmedia_port *this_port,
|
|||
}
|
||||
}
|
||||
|
||||
return PJ_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
static pj_status_t codec_on_destroy(struct pjmedia_port *this_port)
|
||||
|
@ -1029,7 +1029,7 @@ static pj_status_t wsola_plc_get_frame(struct pjmedia_port *this_port,
|
|||
wp->prev_lost = PJ_TRUE;
|
||||
}
|
||||
|
||||
return PJ_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
static pj_status_t wsola_plc_on_destroy(struct pjmedia_port *this_port)
|
||||
|
@ -1202,7 +1202,7 @@ static pj_status_t wsola_discard_get_frame(struct pjmedia_port *this_port,
|
|||
pj_assert(status==PJ_SUCCESS);
|
||||
}
|
||||
|
||||
return PJ_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
static pj_status_t wsola_discard_on_destroy(struct pjmedia_port *this_port)
|
||||
|
@ -2093,7 +2093,7 @@ static pj_status_t delaybuf_get_frame(struct pjmedia_port *this_port,
|
|||
}
|
||||
}
|
||||
|
||||
return PJ_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
static pj_status_t delaybuf_put_frame(struct pjmedia_port *this_port,
|
||||
|
@ -2121,7 +2121,7 @@ static pj_status_t delaybuf_put_frame(struct pjmedia_port *this_port,
|
|||
}
|
||||
}
|
||||
|
||||
return PJ_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
static pj_status_t delaybuf_on_destroy(struct pjmedia_port *this_port)
|
||||
|
@ -2365,6 +2365,7 @@ static pj_timestamp run_entry(unsigned clock_rate, struct test_entry *e)
|
|||
pj_assert(status == PJ_SUCCESS);
|
||||
}
|
||||
}
|
||||
PJ_UNUSED_ARG(status);
|
||||
pj_get_timestamp(&t1);
|
||||
|
||||
pj_sub_timestamp(&t1, &t0);
|
||||
|
|
|
@ -288,6 +288,7 @@ static int stun_destroy_test(void)
|
|||
0, 0, &test_sess.worker_threads[i]);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
}
|
||||
PJ_UNUSED_ARG(status);
|
||||
|
||||
/* Test 1: Main thread calls destroy while callback is processing response */
|
||||
PJ_LOG(3,(THIS_FILE, " Destroy in main thread while callback is running"));
|
||||
|
|
|
@ -402,11 +402,7 @@ static void destroy_sess(struct test_sess *sess, unsigned wait_msec)
|
|||
sess->server2 = NULL;
|
||||
}
|
||||
|
||||
if (sess->pool) {
|
||||
pj_pool_t *pool = sess->pool;
|
||||
sess->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&sess->pool);
|
||||
}
|
||||
|
||||
static void ice_on_rx_data(pj_ice_strans *ice_st,
|
||||
|
|
|
@ -254,11 +254,7 @@ void destroy_test_server(test_server *test_srv)
|
|||
test_srv->dns_server = NULL;
|
||||
}
|
||||
|
||||
if (test_srv->pool) {
|
||||
pj_pool_t *pool = test_srv->pool;
|
||||
test_srv->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&test_srv->pool);
|
||||
}
|
||||
|
||||
static pj_bool_t stun_on_data_recvfrom(pj_activesock_t *asock,
|
||||
|
|
|
@ -318,6 +318,7 @@ static pj_stun_msg* create1(pj_pool_t *pool)
|
|||
PJ_STUN_IS_DATAGRAM | PJ_STUN_CHECK_PACKET,
|
||||
&msg, NULL, &res);
|
||||
pj_assert(status != PJ_SUCCESS);
|
||||
PJ_UNUSED_ARG(status);
|
||||
pj_assert(res != NULL);
|
||||
|
||||
return res;
|
||||
|
|
|
@ -184,7 +184,7 @@ PJ_DEF(pj_status_t) pjnath_init(void)
|
|||
&pjnath_strerror2);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
|
||||
return PJ_SUCCESS;
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -461,11 +461,8 @@ static void ice_on_destroy(void *obj)
|
|||
{
|
||||
pj_ice_sess *ice = (pj_ice_sess*) obj;
|
||||
|
||||
if (ice->pool) {
|
||||
pj_pool_t *pool = ice->pool;
|
||||
ice->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&ice->pool);
|
||||
|
||||
LOG4((THIS_FILE, "ICE session %p destroyed", ice));
|
||||
}
|
||||
|
||||
|
|
|
@ -474,11 +474,7 @@ static void stun_sock_destructor(void *obj)
|
|||
}
|
||||
*/
|
||||
|
||||
if (stun_sock->pool) {
|
||||
pj_pool_t *pool = stun_sock->pool;
|
||||
stun_sock->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
}
|
||||
pj_pool_safe_release(&stun_sock->pool);
|
||||
|
||||
TRACE_(("", "STUN sock %p destroyed", stun_sock));
|
||||
|
||||
|
|
|
@ -328,12 +328,8 @@ static void turn_sess_on_destroy(void *comp)
|
|||
|
||||
/* Destroy pool */
|
||||
if (sess->pool) {
|
||||
pj_pool_t *pool = sess->pool;
|
||||
|
||||
PJ_LOG(4,(sess->obj_name, "TURN client session destroyed"));
|
||||
|
||||
sess->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&sess->pool);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -217,10 +217,8 @@ static void turn_sock_on_destroy(void *comp)
|
|||
pj_turn_sock *turn_sock = (pj_turn_sock*) comp;
|
||||
|
||||
if (turn_sock->pool) {
|
||||
pj_pool_t *pool = turn_sock->pool;
|
||||
PJ_LOG(4,(turn_sock->obj_name, "TURN socket destroyed"));
|
||||
turn_sock->pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&turn_sock->pool);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2010,10 +2010,7 @@ static pj_status_t app_destroy()
|
|||
pjsua_conf_remove_port(app_config.tone_slots[i]);
|
||||
}
|
||||
|
||||
if (app_config.pool) {
|
||||
pj_pool_release(app_config.pool);
|
||||
app_config.pool = NULL;
|
||||
}
|
||||
pj_pool_safe_release(&app_config.pool);
|
||||
|
||||
status = pjsua_destroy();
|
||||
|
||||
|
|
|
@ -207,10 +207,6 @@ pj_status_t cli_init()
|
|||
/* Init telnet frontend */
|
||||
if (app_config.cli_cfg.cli_fe & CLI_FE_TELNET) {
|
||||
pj_cli_telnet_cfg *fe_cfg = &app_config.cli_cfg.telnet_cfg;
|
||||
pj_pool_t *pool;
|
||||
|
||||
pool = pj_pool_create(cfg->pf, "cli_cp", 128, 128, NULL);
|
||||
pj_assert(pool);
|
||||
|
||||
status = pj_cli_telnet_create(cli, fe_cfg, &telnet_front_end);
|
||||
if (status != PJ_SUCCESS)
|
||||
|
|
|
@ -300,6 +300,7 @@ int main(int argc, char *argv[])
|
|||
char s[10], *dummy;
|
||||
puts("ENTER to quit");
|
||||
dummy = fgets(s, sizeof(s), stdin);
|
||||
PJ_UNUSED_ARG(dummy);
|
||||
}
|
||||
|
||||
/* Done. */
|
||||
|
|
|
@ -296,6 +296,7 @@ static void record(unsigned rec_index, const char *filename)
|
|||
|
||||
PJ_LOG(3,(THIS_FILE, "Recording started, press ENTER to stop"));
|
||||
dummy = fgets(line, sizeof(line), stdin);
|
||||
PJ_UNUSED_ARG(dummy);
|
||||
|
||||
on_return:
|
||||
if (strm) {
|
||||
|
@ -363,6 +364,7 @@ static void play_file(unsigned play_index, const char *filename)
|
|||
|
||||
PJ_LOG(3,(THIS_FILE, "Playback started, press ENTER to stop"));
|
||||
dummy = fgets(line, sizeof(line), stdin);
|
||||
PJ_UNUSED_ARG(dummy);
|
||||
|
||||
on_return:
|
||||
if (strm) {
|
||||
|
|
|
@ -467,13 +467,13 @@ static int main_func(int argc, char *argv[])
|
|||
if (argc != 2) {
|
||||
puts("Error: filename required");
|
||||
puts(desc);
|
||||
return 1;
|
||||
return 110;
|
||||
}
|
||||
|
||||
|
||||
/* Must init PJLIB first: */
|
||||
status = pj_init();
|
||||
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1);
|
||||
PJ_ASSERT_RETURN(status == PJ_SUCCESS, 120);
|
||||
|
||||
/* Must create a pool factory before we can allocate any memory. */
|
||||
pj_caching_pool_init(&cp, &pj_pool_factory_default_policy, 0);
|
||||
|
@ -492,24 +492,31 @@ static int main_func(int argc, char *argv[])
|
|||
pjmedia_vid_codec_mgr_create(pool, NULL);
|
||||
|
||||
status = pjmedia_vid_dev_subsys_init(&cp.factory);
|
||||
if (status != PJ_SUCCESS)
|
||||
if (status != PJ_SUCCESS) {
|
||||
rc = 130;
|
||||
goto on_return;
|
||||
}
|
||||
|
||||
status = pjmedia_aud_subsys_init(&cp.factory);
|
||||
if (status != PJ_SUCCESS) {
|
||||
rc = 140;
|
||||
goto on_return;
|
||||
}
|
||||
|
||||
#if defined(PJMEDIA_HAS_OPENH264_CODEC) && PJMEDIA_HAS_OPENH264_CODEC != 0
|
||||
status = pjmedia_codec_openh264_vid_init(NULL, &cp.factory);
|
||||
if (status != PJ_SUCCESS)
|
||||
if (status != PJ_SUCCESS) {
|
||||
rc = 150;
|
||||
goto on_return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if PJMEDIA_HAS_FFMPEG_VID_CODEC
|
||||
status = pjmedia_codec_ffmpeg_vid_init(NULL, &cp.factory);
|
||||
if (status != PJ_SUCCESS)
|
||||
if (status != PJ_SUCCESS) {
|
||||
rc = 160;
|
||||
goto on_return;
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = aviplay(pool, argv[1]);
|
||||
|
@ -548,7 +555,7 @@ on_return:
|
|||
pj_shutdown();
|
||||
|
||||
/* Done. */
|
||||
return 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
|
|
@ -1475,6 +1475,7 @@ static int client_thread(void *arg)
|
|||
} else {
|
||||
status = submit_job();
|
||||
}
|
||||
PJ_UNUSED_ARG(status);
|
||||
|
||||
++app.client.job_submitted;
|
||||
++cycle;
|
||||
|
|
|
@ -1397,14 +1397,12 @@ static void call_on_media_update( pjsip_inv_session *inv,
|
|||
pj_status_t status)
|
||||
{
|
||||
struct call *call;
|
||||
pj_pool_t *pool;
|
||||
struct media_stream *audio;
|
||||
const pjmedia_sdp_session *local_sdp, *remote_sdp;
|
||||
struct codec *codec_desc = NULL;
|
||||
unsigned i;
|
||||
|
||||
call = inv->mod_data[mod_siprtp.id];
|
||||
pool = inv->dlg->pool;
|
||||
audio = &call->media[0];
|
||||
|
||||
/* If this is a mid-call media update, then destroy existing media */
|
||||
|
|
|
@ -190,6 +190,7 @@ static pj_status_t loop_send_msg( pjsip_transport *tp,
|
|||
size_eaten = pjsip_tpmgr_receive_packet( loop->base.tpmgr,
|
||||
&recv_pkt->rdata);
|
||||
pj_assert(size_eaten == recv_pkt->rdata.pkt_info.len);
|
||||
PJ_UNUSED_ARG(size_eaten);
|
||||
|
||||
pjsip_endpt_release_pool(loop->base.endpt,
|
||||
recv_pkt->rdata.tp_info.pool);
|
||||
|
@ -336,6 +337,7 @@ static int loop_transport_worker_thread(void *arg)
|
|||
|
||||
/* Must "eat" all the packets. */
|
||||
pj_assert(size_eaten == node->rdata.pkt_info.len);
|
||||
PJ_UNUSED_ARG(size_eaten);
|
||||
|
||||
/* Done. */
|
||||
pjsip_endpt_release_pool(loop->base.endpt,
|
||||
|
|
|
@ -566,12 +566,8 @@ static void lis_on_destroy(void *arg)
|
|||
}
|
||||
|
||||
if (listener->factory.pool) {
|
||||
pj_pool_t *pool = listener->factory.pool;
|
||||
|
||||
PJ_LOG(4,(listener->factory.obj_name, "SIP TCP transport destroyed"));
|
||||
|
||||
listener->factory.pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&listener->factory.pool);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -603,12 +603,8 @@ static void lis_on_destroy(void *arg)
|
|||
}
|
||||
|
||||
if (listener->factory.pool) {
|
||||
pj_pool_t *pool = listener->factory.pool;
|
||||
|
||||
PJ_LOG(4,(listener->factory.obj_name, "SIP TLS transport destroyed"));
|
||||
|
||||
listener->factory.pool = NULL;
|
||||
pj_pool_release(pool);
|
||||
pj_pool_safe_release(&listener->factory.pool);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2599,6 +2599,7 @@ PJ_DEF(pj_status_t) pjsua_acc_set_registration( pjsua_acc_id acc_id,
|
|||
d = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, tdata->msg->line.req.uri,
|
||||
uri, acc->cfg.reg_uri.slen+10);
|
||||
pj_assert(d > 0);
|
||||
PJ_UNUSED_ARG(d);
|
||||
|
||||
h = pjsip_authorization_hdr_create(tdata->pool);
|
||||
h->scheme = pj_str("Digest");
|
||||
|
|
|
@ -3316,6 +3316,7 @@ static pj_bool_t check_lock_codec(pjsua_call *call)
|
|||
|
||||
/* Verify that media must be active. */
|
||||
pj_assert(loc_m->desc.port && rem_m->desc.port);
|
||||
PJ_UNUSED_ARG(loc_m);
|
||||
|
||||
/* Count the formats in the answer. */
|
||||
for (j=0; j<rem_m->desc.fmt_count && codec_cnt <= 1; ++j) {
|
||||
|
|
|
@ -2252,6 +2252,8 @@ pj_status_t pjsua_media_channel_create_sdp(pjsua_call_id call_id,
|
|||
if (call->inv && call->inv->neg)
|
||||
sdp_neg_state = pjmedia_sdp_neg_get_state(call->inv->neg);
|
||||
|
||||
PJ_UNUSED_ARG(sdp_neg_state);
|
||||
|
||||
/* Get one address to use in the origin field */
|
||||
pj_bzero(&origin, sizeof(origin));
|
||||
for (mi=0; mi<call->med_prov_cnt; ++mi) {
|
||||
|
|
|
@ -184,6 +184,7 @@ static pjmedia_sdp_session *create_sdp(pj_pool_t *pool, const char *body)
|
|||
pj_strdup2_with_null(pool, &dup, body);
|
||||
status = pjmedia_sdp_parse(pool, dup.ptr, dup.slen, &sdp);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
PJ_UNUSED_ARG(status);
|
||||
|
||||
return sdp;
|
||||
}
|
||||
|
@ -335,7 +336,7 @@ static pj_bool_t on_rx_request(pjsip_rx_data *rdata)
|
|||
status = pjsip_inv_send_msg(inv_test.uas, tdata);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
|
||||
return PJ_TRUE;
|
||||
return (status == PJ_SUCCESS);
|
||||
}
|
||||
|
||||
return PJ_FALSE;
|
||||
|
@ -392,6 +393,7 @@ static void run_job(job_t *j)
|
|||
pj_assert(status == PJ_SUCCESS);
|
||||
break;
|
||||
}
|
||||
PJ_UNUSED_ARG(status);
|
||||
}
|
||||
|
||||
|
||||
|
@ -676,6 +678,7 @@ int inv_offer_answer_test(void)
|
|||
pj_sockaddr_in_init(&addr, NULL, PORT);
|
||||
status = pjsip_udp_transport_start(endpt, &addr, NULL, 1, &tp);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
PJ_UNUSED_ARG(status);
|
||||
}
|
||||
|
||||
/* Do tests */
|
||||
|
|
|
@ -204,7 +204,7 @@ static pj_bool_t regs_rx_request(pjsip_rx_data *rdata)
|
|||
&hdr_list, NULL, NULL);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
|
||||
return PJ_TRUE;
|
||||
return (status == PJ_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
|
@ -242,6 +242,7 @@ static void client_cb(struct pjsip_regc_cbparam *param)
|
|||
|
||||
status = pjsip_regc_get_info(param->regc, &info);
|
||||
pj_assert(status == PJ_SUCCESS);
|
||||
PJ_UNUSED_ARG(status);
|
||||
|
||||
client->error = (param->status != PJ_SUCCESS);
|
||||
client->code = param->code;
|
||||
|
|
|
@ -777,8 +777,7 @@ static pj_bool_t msg_receiver_on_rx_request(pjsip_rx_data *rdata)
|
|||
timer.entry.user_data = r;
|
||||
pjsip_endpt_schedule_timer(endpt, &timer.entry, &delay);
|
||||
|
||||
return PJ_TRUE;
|
||||
|
||||
return (status == PJ_SUCCESS);
|
||||
|
||||
} else
|
||||
if (pj_stricmp2(&rdata->msg_info.via->branch_param, TEST8_BRANCH_ID) == 0) {
|
||||
|
@ -850,7 +849,7 @@ static pj_bool_t msg_receiver_on_rx_request(pjsip_rx_data *rdata)
|
|||
* provisional response.
|
||||
*/
|
||||
pjsip_method *method;
|
||||
pj_status_t status;
|
||||
pj_status_t status = PJ_SUCCESS;
|
||||
|
||||
method = &rdata->msg_info.msg->line.req.method;
|
||||
|
||||
|
@ -933,7 +932,7 @@ static pj_bool_t msg_receiver_on_rx_request(pjsip_rx_data *rdata)
|
|||
|
||||
}
|
||||
|
||||
return PJ_TRUE;
|
||||
return (status == PJ_SUCCESS);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue