mirror of
https://github.com/curl/curl.git
synced 2026-05-18 09:56:20 +03:00
CURLMOPT_TIMERFUNCTION.md: correct the example
Fixes #17301 Reported-by: Dirk Feytons Closes #17303
This commit is contained in:
parent
1499319442
commit
cd7904f5a9
2 changed files with 5 additions and 4 deletions
|
|
@ -50,7 +50,7 @@ static int timerfunc(CURLM *multi, long timeout_ms, void *clientp)
|
|||
struct priv *mydata = clientp;
|
||||
printf("our ptr: %p\n", mydata->custom);
|
||||
|
||||
if(timeout_ms) {
|
||||
if(timeout_ms >= 0) {
|
||||
/* this is the new single timeout to wait for */
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,8 @@ time *replaces* the former timeout. The application should then effectively
|
|||
cancel the old timeout and set a new timeout using this new expire time.
|
||||
|
||||
A **timeout_ms** value of -1 passed to this callback means you should delete
|
||||
the timer. All other values are valid expire times in number of milliseconds.
|
||||
the timer. All other values are valid expire times in number of milliseconds -
|
||||
including zero milliseconds.
|
||||
|
||||
The **timer_callback** is called when the timeout expire time is changed.
|
||||
|
||||
|
|
@ -82,8 +83,8 @@ static int timerfunc(CURLM *multi, long timeout_ms, void *clientp)
|
|||
struct priv *mydata = clientp;
|
||||
printf("our ptr: %p\n", mydata->custom);
|
||||
|
||||
if(timeout_ms) {
|
||||
/* this is the new single timeout to wait for */
|
||||
if(timeout_ms >= 0) {
|
||||
/* this is the new single timeout to wait for, including zero */
|
||||
}
|
||||
else {
|
||||
/* delete the timeout, nothing to wait for now */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue