From f5169e0066c86530d23fedc11f8dd94ef20d9c7f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 26 Jun 2012 13:11:07 +0200 Subject: [PATCH] ignore tunnel transmissions errors (usually when not ready) for SIP --- coreapi/TunnelManager.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc index 44d12251c..e3c7e6595 100644 --- a/coreapi/TunnelManager.cc +++ b/coreapi/TunnelManager.cc @@ -31,15 +31,16 @@ Mutex TunnelManager::sMutex; int TunnelManager::eXosipSendto(int fd,const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen,void* userdata){ TunnelManager* lTunnelMgr=(TunnelManager*)userdata; - int err; + sMutex.lock(); if (lTunnelMgr->mSipSocket==NULL){ sMutex.unlock(); - return len;//let ignore the error + return len; } - err=lTunnelMgr->mSipSocket->sendto(buf,len,to,tolen); + lTunnelMgr->mSipSocket->sendto(buf,len,to,tolen); sMutex.unlock(); - return err; + //ignore the error in all cases, retransmissions might be successful. + return len; } int TunnelManager::eXosipRecvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen,void* userdata){