mirror of
https://github.com/curl/curl.git
synced 2026-05-05 15:17:28 +03:00
test536: do not fail with threaded DNS resolver
Also tweaked comments in certain examples using curl_multi_fdset().
This commit is contained in:
parent
71be565cf4
commit
d487ade72c
8 changed files with 46 additions and 22 deletions
|
|
@ -140,7 +140,7 @@ int main(int argc, char **argv)
|
|||
fd_set fdread;
|
||||
fd_set fdwrite;
|
||||
fd_set fdexcep;
|
||||
int maxfd;
|
||||
int maxfd = -1;
|
||||
|
||||
FD_ZERO(&fdread);
|
||||
FD_ZERO(&fdwrite);
|
||||
|
|
@ -154,8 +154,10 @@ int main(int argc, char **argv)
|
|||
curl_multi_fdset(multi_handle, &fdread, &fdwrite, &fdexcep, &maxfd);
|
||||
|
||||
/* In a real-world program you OF COURSE check the return code of the
|
||||
function calls, *and* you make sure that maxfd is bigger than -1
|
||||
so that the call to select() below makes sense! */
|
||||
function calls. On success, the value of maxfd is guaranteed to be
|
||||
greater or equal than -1. We call select(maxfd + 1, ...), specially in
|
||||
case of (maxfd == -1), we call select(0, ...), which is basically equal
|
||||
to sleep. */
|
||||
|
||||
rc = select(maxfd+1, &fdread, &fdwrite, &fdexcep, &timeout);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue