X-Git-Url: http://sjero.net/git/?p=linphone;a=blobdiff_plain;f=coreapi%2FTunnelManager.cc;h=409f9c42a83635c41ba6ff2890b7166aae46d9f6;hp=4828bf114fbfc1b474ddaa09ba27203bebda6a8f;hb=5f0d5793b7e65a518076de6f8e253770503f8824;hpb=a6c141062397872c64e17ad6b8360888d3c3e6f0 diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc index 4828bf11..409f9c42 100644 --- a/coreapi/TunnelManager.cc +++ b/coreapi/TunnelManager.cc @@ -102,6 +102,10 @@ int TunnelManager::eXosipSelect(int max_fds, fd_set *s1, fd_set *s2, fd_set *s3, void TunnelManager::addServer(const char *ip, int port,unsigned int udpMirrorPort,unsigned int delay) { + if (ip == NULL) { + ip = ""; + ms_warning("Adding tunnel server with empty ip, it will not work!"); + } addServer(ip,port); mUdpMirrorClients.push_back(UdpMirrorClient(ServerAddr(ip,udpMirrorPort),delay)); } @@ -185,7 +189,7 @@ bool TunnelManager::isStarted() { } bool TunnelManager::isReady() const { - return mTunnelClient && mTunnelClient->isReady(); + return mTunnelClient && mTunnelClient->isReady() && mReady; } int TunnelManager::customSendto(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen){ @@ -210,6 +214,7 @@ TunnelManager::TunnelManager(LinphoneCore* lc) :TunnelClientController() ,mEnabled(false) ,mTunnelClient(NULL) ,mAutoDetectStarted(false) +,mReady(false) ,mHttpProxyPort(0){ mExosipTransport.data=this; @@ -267,6 +272,7 @@ void TunnelManager::processTunnelEvent(const Event &ev){ if (lProxy) { linphone_proxy_config_done(lProxy); } + mReady=true; }else if (mEnabled && !mTunnelClient->isReady()){ /* we got disconnected from the tunnel */ if (lProxy && linphone_proxy_config_is_registered(lProxy)) { @@ -274,6 +280,7 @@ void TunnelManager::processTunnelEvent(const Event &ev){ linphone_proxy_config_edit(lProxy); linphone_core_iterate(mCore); } + mReady=false; } } @@ -313,7 +320,7 @@ void TunnelManager::enable(bool isEnable) { mEnabled=false; stopClient(); - + mReady=false; linphone_core_set_rtp_transport_factories(mCore,NULL); eXosip_transport_hook_register(NULL);