Commit 4caf9ed0 authored by Mickaël Turnel's avatar Mickaël Turnel
Browse files

Removed tunnel logging functions since it is now done with bctoolbox

(cherry picked from commit fefd58f307015c19bfb9ef1d3d350380c4245c6d)
(cherry picked from commit a5740cd5)

# Conflicts:
#	coreapi/private.h
parent e5a15190
......@@ -426,45 +426,6 @@ void TunnelManager::sOnIterate(TunnelManager *zis){
zis->onIterate();
}
#ifdef __ANDROID__
extern void linphone_android_log_handler(int prio, char *str);
static void linphone_android_tunnel_log_handler(int lev, const char *fmt, va_list args) {
char str[4096];
vsnprintf(str, sizeof(str) - 1, fmt, args);
str[sizeof(str) - 1] = '\0';
int prio;
switch(lev){
case TUNNEL_DEBUG: prio = ANDROID_LOG_DEBUG; break;
case TUNNEL_INFO: prio = ANDROID_LOG_INFO; break;
case TUNNEL_NOTICE: prio = ANDROID_LOG_INFO; break;
case TUNNEL_WARN: prio = ANDROID_LOG_WARN; break;
case TUNNEL_ERROR: prio = ANDROID_LOG_ERROR; break;
default: prio = ANDROID_LOG_DEFAULT; break;
}
linphone_android_log_handler(prio, str);
}
#endif /* __ANDROID__ */
void TunnelManager::enableLogs(bool value) {
enableLogs(value,NULL);
}
void TunnelManager::enableLogs(bool isEnabled,LogHandler logHandler) {
if (logHandler != NULL) SetLogHandler(logHandler);
#ifdef __ANDROID__
else SetLogHandler(linphone_android_tunnel_log_handler);
#else
else SetLogHandler(tunnel_default_log_handler);
#endif
if (isEnabled) {
SetLogLevel(TUNNEL_ERROR|TUNNEL_WARN|TUNNEL_INFO);
} else {
SetLogLevel(TUNNEL_ERROR|TUNNEL_WARN);
}
}
LinphoneTunnelMode TunnelManager::getMode() const {
return mMode;
}
......
......@@ -118,14 +118,6 @@ namespace belledonnecomm {
* @return #LinphoneTunnelMode
*/
LinphoneTunnelMode getMode() const;
/**
* Enables debug logs of the Tunnel subsystem.
**/
void enableLogs(bool isEnabled);
/**
* Enables debugs logs of the Tunnel subsystem and specify a callback where to receive the debug messages.
**/
void enableLogs(bool isEnabled,LogHandler logHandler);
/**
* iOS only feature: specify http proxy credentials.
* When the iOS device has an http proxy configured in the iOS settings, the tunnel client will connect to the server
......
......@@ -345,56 +345,6 @@ bool_t linphone_tunnel_get_activated(const LinphoneTunnel *tunnel){
return bcTunnel(tunnel)->isActivated();
}
static OrtpLogFunc tunnelOrtpLogHandler=NULL;
/*
#define TUNNEL_DEBUG (1)
#define TUNNEL_INFO (1<<1)
#define TUNNEL_NOTICE (1<<2)
#define TUNNEL_WARN (1<<3)
#define TUNNEL_ERROR (1<<4)
#define TUNNEL_ALERT (1<<5)
#define TUNNEL_FATAL (1<<6)
*/
static void tunnelLogHandler(int level, const char *fmt, va_list l){
if (tunnelOrtpLogHandler){
OrtpLogLevel ortp_level=ORTP_DEBUG;
switch(level){
case TUNNEL_DEBUG:
ortp_level=ORTP_DEBUG;
break;
case TUNNEL_INFO:
ortp_level=ORTP_MESSAGE;
break;
case TUNNEL_NOTICE:
ortp_level=ORTP_MESSAGE;
break;
case TUNNEL_WARN:
ortp_level=ORTP_WARNING;
break;
case TUNNEL_ERROR:
ortp_level=ORTP_ERROR;
break;
case TUNNEL_ALERT:
ortp_level=ORTP_ERROR;
break;
case TUNNEL_FATAL:
ortp_level=ORTP_FATAL;
break;
default:
ms_fatal("Unexepcted tunnel log %i: %s",level,fmt);
break;
}
tunnelOrtpLogHandler("tunnel", ortp_level,fmt,l);
}
}
void linphone_tunnel_enable_logs_with_handler(LinphoneTunnel *tunnel, bool_t enabled, OrtpLogFunc logHandler){
tunnelOrtpLogHandler=logHandler;
bcTunnel(tunnel)->enableLogs(enabled == FALSE ? false : true, tunnelLogHandler);
}
void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel *tunnel, const char* username,const char* passwd){
bcTunnel(tunnel)->setHttpProxyAuthInfo(username, passwd);
}
......@@ -436,10 +386,6 @@ bool_t linphone_tunnel_verify_server_certificate_enabled(const LinphoneTunnel *t
return bcTunnel(tunnel)->verifyServerCertificateEnabled() ? TRUE : FALSE;
}
static void my_ortp_logv(const char *domain, OrtpLogLevel level, const char *fmt, va_list args){
ortp_logv(domain, level,fmt,args);
}
/**
* Startup tunnel using configuration.
......@@ -456,7 +402,6 @@ void linphone_tunnel_configure(LinphoneTunnel *tunnel){
bcTunnel(tunnel)->setHttpProxy(http_host, http_port, http_username, http_passwd);
linphone_tunnel_enable_dual_mode(tunnel, useDualMode);
linphone_tunnel_enable_logs_with_handler(tunnel,TRUE,my_ortp_logv);
linphone_tunnel_load_config(tunnel);
linphone_tunnel_enable_sip(tunnel, tunnelizeSIPPackets);
linphone_tunnel_verify_server_certificate(tunnel, tunnelVerifyServerCertificate);
......
......@@ -90,9 +90,6 @@ bool_t linphone_tunnel_get_activated(const LinphoneTunnel *tunnel){
return FALSE;
}
void linphone_tunnel_enable_logs_with_handler(LinphoneTunnel *tunnel, bool_t enabled, OrtpLogFunc logHandler){
}
void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel *tunnel, const char* username,const char* passwd){
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment