Skip to content

Example programs for CURLMOPT_TIMERFUNCTION don't handle timeout_ms == -1 correctly #1253

@mkauf

Description

@mkauf

I did this

Studied the code of the example programs for CURLMOPT_TIMERFUNCTION:

These example programs don't handle timeout_ms == -1 correctly.

I expected the following

The documentation for CURLMOPT_TIMERFUNCTION says:

A timeout_ms value of -1 means you should delete your timer.

These example programs call curl_multi_socket_action() instead:

  • asiohiper.cpp
  • evhiperfifo.c
  • multi-uv.c

These exampe programs schedule a new timer instead:

  • ghiper.c
  • hiperfifo.c

Note that the timeout value 0 also has a special meaning:

A timeout_ms value of 0 means you should call curl_multi_socket_action or curl_multi_perform (once) as soon as possible.

curl/libcurl version

7.52.1

operating system

All

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions