diff options
author | Daniel Stenberg <daniel@haxx.se> | 2013-08-10 22:55:59 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2013-08-20 11:56:06 +0200 |
commit | 6cf8413e31629183b3c749aa2a17d24be14cbca1 (patch) | |
tree | 4eefcd397f973dee660b823af175ebd7188d4901 /src/tool_operate.c | |
parent | 062e5bfd9c3a05b9234144dc782e232804916b5e (diff) |
curl_easy_perform_ev: debug/test function
This function is meant to work *exactly* as curl_easy_perform() but will
use the event-based libcurl API internally instead of
curl_multi_perform(). To avoid relying on an actual event-based library
and to not use non-portable functions (like epoll or similar), there's a
rather inefficient emulation layer implemented on top of Curl_poll()
instead.
There's currently some convenience logging done in curl_easy_perform_ev
which helps when tracking down problems. They may be suitable to remove
or change once things seem to be fine enough.
curl has a new --test-event option when built with debug enabled that
then uses curl_easy_perform_ev() instead of curl_easy_perform(). If
built without debug, using --test-event will only output a warning
message.
NOTE: curl_easy_perform_ev() is not part if the public API on purpose.
It is only present in debug builds of libcurl and MUST NOT be considered
stable even then. Use it for libcurl-testing purposes only.
runtests.pl now features an -e command line option that makes it use
--test-event for all curl command line tests. The man page is updated.
Diffstat (limited to 'src/tool_operate.c')
-rw-r--r-- | src/tool_operate.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tool_operate.c b/src/tool_operate.c index dbbbc26c2..60d09ff25 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -81,6 +81,11 @@ #include "memdebug.h" /* keep this as LAST include */ +#ifdef CURLDEBUG +/* libcurl's debug builds provide an extra function */ +CURLcode curl_easy_perform_ev(CURL *easy); +#endif + #define CURLseparator "--_curl_--" #ifndef O_BINARY @@ -1450,6 +1455,11 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[]) mlfile->filename, this_url); #endif /* USE_METALINK */ +#ifdef CURLDEBUG + if(config->test_event_based) + res = curl_easy_perform_ev(curl); + else +#endif res = curl_easy_perform(curl); if(outs.is_cd_filename && outs.stream && !config->mute && |