From 789f1ff7b5ae93a1db6ae9e18c1c2f669035be0e Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Wed, 13 Jul 2011 20:47:56 +0200 Subject: [PATCH] Update to latest Csocket This fixes the "busy loop waiting for an SSL handshake to finish" which the last "Update to latest Csocket" was already supposed to fix. However, that fix had a bug if poll() is used instead of select(). poll()'s timeout argument is in milliseconds while select also allows microseconds. Since Csocket originally used select(), it expects the microseconds-approach. This means it has to divide by 1000 to get the timeout argument for poll(). However, the iQuickReset which was used to "fix" (rather: hide) the busy loop was less than 1ms so this still resulted in a timeout of 0 (= busy loop) because integer division truncates the result. Signed-off-by: Uli Schlachter --- Csocket.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Csocket.h b/Csocket.h index b3ea1d81..18f6528f 100644 --- a/Csocket.h +++ b/Csocket.h @@ -1991,7 +1991,7 @@ private: std::map< int, short > miiReadyFds; tv.tv_sec = m_iSelectWait / 1000000; tv.tv_usec = m_iSelectWait % 1000000; - u_int iQuickReset = 100; + u_int iQuickReset = 1000; if ( m_iSelectWait == 0 ) iQuickReset = 0;