Skip to content

Unexpected timeouts #3305

Closed
Closed
@frikiluser

Description

@frikiluser

Hi,

I did this

I have a simple URL that takes some time before reply.
For example: "http://127.0.0.1/sleep.php?sleep=5.3" will took 5.3 seconds.

<?php
usleep($_GET['sleep']*1000*1000):
echo "OK";

I also have a small program based on (https://curl.haxx.se/libcurl/c/simple.html).
Basically I've changed the URL and added timeout control:
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 6L);
Or (tested both with same results):
curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, 6*1000);

When I run the program it raises a timeout error after 6 seconds of execution.
curl_easy_perform() failed: Timeout was reached

I expected the following

Timeout should not be raised when the client receives the response before the specified timeout option.

curl/libcurl version

After some work, I've found the problem starts with this commit, merged before 7.61.0:
3ef67c6

operating system

Linux 4.18.0-2-amd64 (Debian based)

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