From d43e284961bf71fd45e2d5c92bfb7ab862d8ef91 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 25 Jun 2010 01:31:25 +0000 Subject: [PATCH] (trunk libt) #3311 "MingW build of Transmission" -- possible win32 fix for the curl thread's select() call. probably broken... :) --- libtransmission/web.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libtransmission/web.c b/libtransmission/web.c index 6ff66b5f3..20112f481 100644 --- a/libtransmission/web.c +++ b/libtransmission/web.c @@ -304,7 +304,17 @@ tr_webThreadFunc( void * vsession ) t.tv_sec = usec / 1000000; t.tv_usec = usec % 1000000; +#ifdef WIN32 + /* see ticket #3311, comments 16-18 */ + if( !r_fd_set.fd_count && !w_fd.set.fd_count && !c_fd_set.fd_count ) + tr_wait( msec ); + else + select( 0, r_fd_set.fd_count ? &r_fd_set : NULL, + w_fd.set.fd_count ? &w_fd_set : NULL, + c_fd.set.fd_count ? &c_fd_set : NULL, &t ); +#else select( max_fd+1, &r_fd_set, &w_fd_set, &c_fd_set, &t ); +#endif } /* call curl_multi_perform() */