Bug 17178 - [curl] when using winsock, downloadTimerCallback bails
Summary: [curl] when using winsock, downloadTimerCallback bails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL:
Keywords: Curl, Wx
Depends on:
Blocks:
 
Reported: 2008-02-04 14:44 PST by Kevin Ollivier
Modified: 2008-02-10 11:03 PST (History)
0 users

See Also:


Attachments
On Win, don't call select unless we have a valid file descriptor (1.50 KB, patch)
2008-02-04 14:45 PST, Kevin Ollivier
mrowe: review-
Details | Formatted Diff | Diff
Don't call select when there are no valid file descriptors on any platform (1.83 KB, patch)
2008-02-06 21:24 PST, Kevin Ollivier
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Ollivier 2008-02-04 14:44:29 PST
When building/running CURL with MSVC/winsock, we're seeing curl_multi_fdset return -1 for maxfd (which means there are no valid file descriptors), and this leads to an error when select() is called. That causes the download to bail out, meaning we can't even load pages. If we do not call select() in this case, all downloads start and complete successfully. 

Having this fixed is pretty critical for the wx port on Windows. Attached is a fix for the problem.
Comment 1 Kevin Ollivier 2008-02-04 14:45:12 PST
Created attachment 18919 [details]
On Win, don't call select unless we have a valid file descriptor
Comment 2 Mark Rowe (bdash) 2008-02-04 20:09:09 PST
Comment on attachment 18919 [details]
On Win, don't call select unless we have a valid file descriptor

That doesn't look right as it makes it possible for rc to be tested before being initialized.  Why does it make sense to call select on non-Windows platforms when there are no file descriptors?
Comment 3 Kevin Ollivier 2008-02-06 21:24:13 PST
Created attachment 18978 [details]
Don't call select when there are no valid file descriptors on any platform

Good point, I did some more testing and not calling select() seems to work fine on Unix platforms too, so I've taken out the #if PLATFORM(WIN_OS) and I've also initialized rc to 0 so that it won't be used uninitialized.
Comment 4 Eric Seidel (no email) 2008-02-10 10:44:48 PST
Comment on attachment 18978 [details]
Don't call select when there are no valid file descriptors on any platform

Looks fine to me.
Comment 5 Kevin Ollivier 2008-02-10 11:03:24 PST
Landed in r30121. Thanks!