curl-library
curl_multi_fdset() and select()
From: Gisle Vanem <giva_at_bgnett.no>
Date: Sat, 09 Sep 2006 18:15:25 +0200
Date: Sat, 09 Sep 2006 18:15:25 +0200
All (or most?) of the test/libtest/lib*.c programs calling these two
function on Win32, will fail in the first select() since ...
On the first return from curl_multi_fdset(), max_fd would be -1. This doesn't
go well with Winsock; it doesn't like "select (0, ..., &interval)" which is equal
to a sleep(1).
I was thinking of changing the if-statement into:
if (max_fd > -1 && select(max_fd+1, &rd, &wr, &exc, &interval) == -1) {
fprintf(stderr, "bad select??\n");
return 95;
}
Does this hurt on other platforms than Win32? Or should we code our own
select() (in first.c) that handles the max_fd == -1 case?
--gv
Received on 2006-09-09