Commit af33a192 authored by Gautier Pelloux-Prayer's avatar Gautier Pelloux-Prayer
Browse files

tunnel: turn off autodetection if network is not reachable anymore

parent cf902275
......@@ -398,6 +398,12 @@ void TunnelManager::networkReachableCb(LinphoneCore *lc, bool_t reachable) {
LOGI("TunnelManager: Network is now reachable, starting auto detection");
tunnel->startAutoDetection();
tunnel->mState = autodetecting;
} else if (!reachable && tunnel->mState == autodetecting) {
// if network is no more reachable, cancel autodetection
for(UdpMirrorClientList::iterator udpMirror = tunnel->mUdpMirrorClients.begin(); udpMirror != tunnel->mUdpMirrorClients.end(); udpMirror++) {
udpMirror->stop();
}
tunnel->mState = disabled;
}
linphone_core_get_local_ip_for(AF_INET, NULL,tunnel->mLocalAddr);
}
......
......@@ -255,16 +255,15 @@ static void register_on_second_tunnel(void) {
linphone_tunnel_simulate_udp_loss(tunnel, TRUE);
linphone_tunnel_config_set_host(config, "tunnel.linphone.org");
// add a first tunnel config with an invalid port
linphone_tunnel_config_set_port(config, 4141);
linphone_tunnel_config_set_host(config, "tunnel.linphone2.org");
linphone_tunnel_config_set_remote_udp_mirror_port(config, 54321);
linphone_tunnel_add_server(tunnel, config);
// then a proper server
linphone_tunnel_config_set_port(config, 443);
linphone_tunnel_config_set_host(config, "tunnel.linphone.org");
linphone_tunnel_config_set_remote_udp_mirror_port(config, 12345);
linphone_tunnel_add_server(tunnel, config);
......
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