bring csocket changes up to date with win32 fixes provided by DGandalf, also forgot to implement ares_timeout

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1708 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
imaginos
2010-01-12 18:51:31 +00:00
parent 25ef34398d
commit 5ea1f8cc05
2 changed files with 31 additions and 15 deletions
+4 -10
View File
@@ -28,7 +28,7 @@
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* $Revision: 1.216 $
* $Revision: 1.219 $
*/
// note to compile with win32 need to link to winsock2, using gcc its -lws2_32
@@ -1894,6 +1894,8 @@ private:
if( pChannel )
{
ares_fds( pChannel, &rfds, &wfds );
// let ares drop the timeout if it has something timing out sooner then whats in tv currently
ares_timeout( pChannel, &tv, &tv );
bHasWriteable = true;
}
#endif /* HAVE_C_ARES */
@@ -2029,15 +2031,7 @@ private:
#ifdef HAVE_C_ARES
ares_channel pChannel = pcSock->GetAresChannel();
if( pChannel )
{
int iAresFD;
ares_getsock( pChannel, &iAresFD, 1 );
// only process the channels that are actually set in the read/write set
// this should effectively be the same as finding the max timeout amongst ares fd's
// as this fd is either ready or its not
if( TFD_ISSET( iAresFD, &rfds ) || TFD_ISSET( iAresFD, &wfds ) )
ares_process( pChannel, &rfds, &wfds );
}
ares_process( pChannel, &rfds, &wfds );
#endif /* HAVE_C_ARES */
if ( pcSock->GetConState() != T::CST_OK )