From: <ps...@us...> - 2010-07-02 20:03:47
|
Revision: 2052 http://znc.svn.sourceforge.net/znc/?rev=2052&view=rev Author: psychon Date: 2010-07-02 20:03:41 +0000 (Fri, 02 Jul 2010) Log Message: ----------- Update to latest Csocket This fixes a bug where the wrong errno value was used for SockError(). This also fixes a busy loop caused by broken c-ares timeout handling on our side. Modified Paths: -------------- trunk/Csocket.h Modified: trunk/Csocket.h =================================================================== --- trunk/Csocket.h 2010-07-02 19:59:57 UTC (rev 2051) +++ trunk/Csocket.h 2010-07-02 20:03:41 UTC (rev 2052) @@ -28,7 +28,7 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * -* $Revision: 1.230 $ +* $Revision: 1.232 $ */ // note to compile with win32 need to link to winsock2, using gcc its -lws2_32 @@ -1508,8 +1508,7 @@ cs_ssize_t bytes = pcSock->Read( cBuff(), iLen ); - if ( ( bytes != T::READ_TIMEDOUT ) && ( bytes != T::READ_CONNREFUSED ) - && ( !pcSock->IsConnected() ) ) + if ( bytes != T::READ_TIMEDOUT && bytes != T::READ_CONNREFUSED && bytes != T::READ_ERR && !pcSock->IsConnected() ) { pcSock->SetIsConnected( true ); pcSock->Connected(); @@ -2019,6 +2018,16 @@ m_errno = SELECT_TIMEOUT; else m_errno = SUCCESS; +#ifdef HAVE_C_ARES + // run through ares channels and process timeouts + for( u_long uSock = 0; uSock < this->size(); ++uSock ) + { + T *pcSock = this->at( uSock ); + ares_channel pChannel = pcSock->GetAresChannel(); + if( pChannel ) + ares_process_fd( pChannel, ARES_SOCKET_BAD, ARES_SOCKET_BAD ); + } +#endif /* HAVE_C_ARES */ return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |