Skip to content
Permalink
Browse files

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.
  • Loading branch information...
bagder committed Aug 10, 2013
1 parent 062e5bf commit 6cf8413e31629183b3c749aa2a17d24be14cbca1
Showing with 406 additions and 58 deletions.
  1. +347 −51 lib/easy.c
  2. +3 −0 lib/easyif.h
  3. +4 −1 src/tool_cfgable.h
  4. +8 −0 src/tool_getparam.c
  5. +10 −0 src/tool_operate.c
  6. +5 −1 tests/runtests.1
  7. +29 −5 tests/runtests.pl

2 comments on commit 6cf8413

@gvanem

This comment has been minimized.

Copy link
Member

replied Aug 21, 2013

I build curl.exe (using MingW) with '-DCURLDEBUG' and by importing from libcurl.dll.
Which means the new curl_easy_perform_ev() must be exported from libcurl.dll.
Hence:

--- Git-latest/lib/easyif.h  2013-08-21 15:48:14 +0000
+++ lib/easyif.h    2013-08-21 15:57:25 +0000
@@ -26,7 +26,7 @@
  * Prototypes for library-wide functions provided by easy.c
  */
 #ifdef CURLDEBUG
-CURLcode curl_easy_perform_ev(CURL *easy);
+CURL_EXTERN CURLcode curl_easy_perform_ev(CURL *easy);
 #endif

 #endif /* HEADER_CURL_EASYIF_H */
@bagder

This comment has been minimized.

Copy link
Member Author

replied Aug 21, 2013

Thanks, merged!

Please sign in to comment.
You can’t perform that action at this time.