summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2022-01-17 08:38:15 +0100
committerDaniel Stenberg <daniel@haxx.se>2022-01-17 08:38:15 +0100
commit53ea1ea148ff4111a55c31ceacbe6085b5c672f4 (patch)
tree81a2fa92830408d457f06ee0a46d81f6d7416bb6
parent58397f0005181590169cd632a8db5608f99a93e2 (diff)
downloadcurl-53ea1ea148ff4111a55c31ceacbe6085b5c672f4.tar.gz
CURLMOPT_TIMERFUNCTION/DATA.3: fix the examplesbagder/multi-in-callback
... to not call libcurl recursively back.
-rw-r--r--docs/libcurl/opts/CURLMOPT_TIMERDATA.34
-rw-r--r--docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.312
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/libcurl/opts/CURLMOPT_TIMERDATA.3 b/docs/libcurl/opts/CURLMOPT_TIMERDATA.3
index 40c56fbd2..681b1580b 100644
--- a/docs/libcurl/opts/CURLMOPT_TIMERDATA.3
+++ b/docs/libcurl/opts/CURLMOPT_TIMERDATA.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -68,7 +68,7 @@ static int timerfunc(CURLM *multi, long timeout_ms, void *userp)
id = g_new(guint, 1);
*id = g_timeout_add(timeout_ms, timeout_cb, id);
}
- curl_multi_setopt(multi, CURLMOPT_TIMERDATA, id);
+ current_timer = id;
return 0;
}
diff --git a/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.3 b/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.3
index 5b394296e..a7dfe0a39 100644
--- a/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.3
+++ b/docs/libcurl/opts/CURLMOPT_TIMERFUNCTION.3
@@ -5,7 +5,7 @@
.\" * | (__| |_| | _ <| |___
.\" * \___|\___/|_| \_\_____|
.\" *
-.\" * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+.\" * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
.\" *
.\" * This software is licensed as described in the file COPYING, which
.\" * you should have received as part of this distribution. The terms
@@ -59,10 +59,10 @@ multi handle will be aborted and fail.
This callback can be used instead of, or in addition to,
\fIcurl_multi_timeout(3)\fP.
-\fBWARNING:\fP even if it feels tempting, avoid calling libcurl directly from
-within the callback itself when the \fBtimeout_ms\fP value is zero, since it
-risks triggering an unpleasant recursive behavior that immediately calls
-another call to the callback with a zero timeout...
+\fBWARNING:\fP do not call libcurl directly from within the callback itself
+when the \fBtimeout_ms\fP value is zero, since it risks triggering an
+unpleasant recursive behavior that immediately calls another call to the
+callback with a zero timeout...
.SH DEFAULT
NULL
.SH PROTOCOLS
@@ -97,7 +97,7 @@ static int timerfunc(CURLM *multi, long timeout_ms, void *userp)
id = g_new(guint, 1);
*id = g_timeout_add(timeout_ms, timeout_cb, id);
}
- curl_multi_setopt(multi, CURLMOPT_TIMERDATA, id);
+ current_timer = id;
return 0;
}