Use async workers and enable dns caching
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
#define long long long
|
#define long long long
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
enum { ASYNC_WORKERS = 4 };
|
||||||
|
|
||||||
typedef struct baresip_context
|
typedef struct baresip_context
|
||||||
{
|
{
|
||||||
JavaVM *javaVM;
|
JavaVM *javaVM;
|
||||||
@@ -428,6 +430,8 @@ Java_com_tutpro_baresip_BaresipService_baresipStart(JNIEnv *env, jobject instanc
|
|||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
re_thread_async_init(ASYNC_WORKERS);
|
||||||
|
|
||||||
conf_path_set(path);
|
conf_path_set(path);
|
||||||
|
|
||||||
log_level_set((enum log_level)jLogLevel);
|
log_level_set((enum log_level)jLogLevel);
|
||||||
@@ -446,8 +450,8 @@ Java_com_tutpro_baresip_BaresipService_baresipStart(JNIEnv *env, jobject instanc
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Turn off DNS client cache
|
// Turn off DNS client cache (should be OK with async workers)
|
||||||
dnsc_cache_max(net_dnsc(baresip_network()), 0);
|
// dnsc_cache_max(net_dnsc(baresip_network()), 0);
|
||||||
|
|
||||||
if (strlen(addrs) > 0) {
|
if (strlen(addrs) > 0) {
|
||||||
char* addr_list = (char*)malloc(strlen(addrs));
|
char* addr_list = (char*)malloc(strlen(addrs));
|
||||||
@@ -539,6 +543,8 @@ Java_com_tutpro_baresip_BaresipService_baresipStart(JNIEnv *env, jobject instanc
|
|||||||
LOGD("unloading modules ...");
|
LOGD("unloading modules ...");
|
||||||
mod_close();
|
mod_close();
|
||||||
|
|
||||||
|
re_thread_async_close();
|
||||||
|
|
||||||
libre_close();
|
libre_close();
|
||||||
|
|
||||||
// tmr_debug();
|
// tmr_debug();
|
||||||
|
|||||||
Reference in New Issue
Block a user