aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-10-12 08:36:47 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-10-12 08:36:47 +0000
commitb61c06384ab88baf4b3231e84386c4a70126d888 (patch)
treeaac26b1242718b6093edcefd99c6e3e4b04cd52b /include
parente7742bfb7cc40d6b840fabc8632f9625cc2fc26f (diff)
Jeff Pohlmeyer has been working with the hiperfifo.c example source code,
and while doing so it became apparent that the current timeout system for the socket API really was a bit awkward since it become quite some work to be sure we have the correct timeout set. Jeff then provided the new CURLMOPT_TIMERFUNCTION that is yet another callback the app can set to get to know when the general timeout time changes and thus for an application like hiperfifo.c it makes everything a lot easier and nicer. There's a CURLMOPT_TIMERDATA option too of course in good old libcurl tradition.
Diffstat (limited to 'include')
-rw-r--r--include/curl/multi.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/curl/multi.h b/include/curl/multi.h
index 23fe180d3..d2533728d 100644
--- a/include/curl/multi.h
+++ b/include/curl/multi.h
@@ -231,6 +231,20 @@ typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
pointer */
void *socketp); /* private socket
pointer */
+/*
+ * Name: curl_multi_timer_callback
+ *
+ * Desc: Called by libcurl whenever the library detects a change in the
+ * maximum number of milliseconds the app is allowed to wait before
+ * curl_multi_socket() or curl_multi_perform() must be called
+ * (to allow libcurl's timed events to take place).
+ *
+ * Returns: The callback should return zero.
+ */
+typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
+ long timeout_ms, /* see above */
+ void *userp); /* private callback
+ pointer */
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
int *running_handles);
@@ -273,6 +287,12 @@ typedef enum {
/* set to 1 to enable pipelining for this multi handle */
CINIT(PIPELINING, LONG, 3),
+ /* This is the timer callback function pointer */
+ CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
+
+ /* This is the argument passed to the timer callback */
+ CINIT(TIMERDATA, OBJECTPOINT, 5),
+
CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;