1
0
mirror of https://github.com/moparisthebest/curl synced 2024-10-31 23:55:01 -04:00
Commit Graph

18 Commits

Author SHA1 Message Date
Jay Satiro
cb13fad733 examples: Wait recommended 100ms when no file descriptors are ready
Prior to this change when no file descriptors were ready on platforms
other than Windows the multi examples would sleep whatever was in
timeout, which may or may not have been less than the minimum
recommended value [1] of 100ms.

[1]: http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
2014-11-19 13:34:05 +01:00
Jay Satiro
a607f8a20c examples: Don't call select() to sleep on windows
Windows does not support using select() for sleeping without a dummy
socket. Instead use Windows' Sleep() and sleep for 100ms which is the
minimum suggested value in the curl_multi_fdset() doc.

Prior to this change the multi examples would exit prematurely since
select() would error instead of sleeping when called without an fd.

Reported-by: Johan Lantz
Bug: http://curl.haxx.se/mail/lib-2014-11/0221.html
2014-11-15 21:27:20 +01:00
Dave Reisner
4c070de4fb examples: use do/while loop for multi examples
It's conceivable that after the first time curl_multi_perform returns,
the outvalue still_running will be 0, but work will have been done. This
is shown by a workload of small, purely file:// based URLs. Ensure that
we always read pending messages off the multi handle by forcing the
while loop to run at least once.
2012-08-27 15:10:13 +02:00
Daniel Stenberg
1aeb635cdd sources: update source headers
All C and H files now (should) feature the proper project curl source
code header, which includes basic info, a copyright statement and some
basic disclaimers.
2011-03-10 12:04:33 +01:00
Daniel Stenberg
9583b4af90 examples: fix compiler warnings 2010-12-17 23:34:26 +01:00
Daniel Stenberg
542318b113 multi use: call multi_perform even on select() timeouts 2010-11-04 11:37:23 +01:00
Daniel Stenberg
18e7b52e8e examples: use example.com in example URLs 2010-10-05 15:00:19 +02:00
Dirk Manske
5fb4279ec7 multi & hiper examples: updates and cleanups
all multi and hiper examples:

* don't loop curl_multi_perform calls, that was <7.20.0 style, currently
  the exported multi functions will not return CURLM_CALL_MULTI_PERFORM

all hiper examples:
* renamed check_run_count to check_multi_info
* don't  compare current running handle count with previous value, this
  was the wrong way to check for finished requests, simply call
  curl_multi_info_read
* it's also safe to call curl_multi_remove_handle inside the
  curl_multi_info_read loop.

ghiper.c:
* replaced curl_multi_socket (that function is marked as obsolete) calls
  with curl_multi_socket_action calls (as in hiperfifo.c and
  evhiperfifo.c)

ghiper.c and evhiperfifo.c:
* be smart as hiperfifo.c, don't do uncessary curl_multi_* calls in
  new_conn and main
2010-09-30 22:20:52 +02:00
Constantine Sapuntzakis
bc0699f226 examples: add curl_multi_timeout
Make the multi-interface using examples use curl_multi_timeout to
properly educate users how to do things.
2010-07-14 00:32:53 +02:00
Kamil Dudka
d487ade72c test536: do not fail with threaded DNS resolver
Also tweaked comments in certain examples using curl_multi_fdset().
2010-04-24 12:14:21 +02:00
Daniel Stenberg
2309b4e330 remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
Yang Tse
a07bc79117 removed trailing whitespace 2010-02-14 19:40:18 +00:00
Dan Fandrich
e664cd5826 Fixed a surprising number of example programs that were passing int arguments
to curl_easy_setopt instead of long.
2008-05-22 21:20:07 +00:00
Dan Fandrich
49ce3e5160 Fixed some compile warnings and errors and improved portability in the
examples.
Removed ftp3rdparty.c since libcurl doesn't support 3rd party FTP transfers
any longer.
2007-07-12 21:11:10 +00:00
Daniel Stenberg
f53347631e Added comments about checking return code and the maxfd counter 2006-10-13 14:01:19 +00:00
Daniel Stenberg
80a0b81c2a Make this code use the proper pointers 2006-05-02 09:19:31 +00:00
Daniel Stenberg
3e1caa6185 HTTP "auth done right". See lib/README.httpauth 2004-11-24 16:11:35 +00:00
Daniel Stenberg
3bbf694d5a Added multi-post.c, based on the source file posted by Gustaf Hui 2002-05-06 13:38:28 +00:00