php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58217 Subsecond timeouts always fail
Submitted: 2008-06-03 19:23 UTC Modified: 2008-12-05 07:05 UTC
From: murphyk at yahoo-inc dot com Assigned: mike (profile)
Status: Not a bug Package: pecl_http (PECL)
PHP Version: 4.4.7 OS: RHEL 4.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: murphyk at yahoo-inc dot com
New email:
PHP Version: OS:

 

 [2008-06-03 19:23 UTC] murphyk at yahoo-inc dot com
Description:
------------
Using floats for sub-second timeouts, which should be supported with my version of libcurl (7.16.3), doesn't appear to work.

Sample code below. 

Reproduce code:
---------------
<?php

$r = pecl_http_get('http://127.0.0.1', array('timeout' => 1.0));

$r = pecl_http_get('http://127.0.0.1',array('timeout' => 0.999));

?>

Expected result:
----------------
I would expect both calls to succeed - the local webserver is responding in less than 999 milliseconds.

Actual result:
--------------
The first call always succeeds, the second always fails (for any float value below 1) with:

Warning: http_get(): a timeout was reached; a timeout was reached (http://127.0.0.1/)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-06-03 19:35 UTC] murphyk at yahoo-inc dot com
Reproduce code should be:

<?php

$r = http_get('http://127.0.0.1', array('timeout' => 1.0));

$r = http_get('http://127.0.0.1',array('timeout' => 0.999));

?>
 [2008-07-11 05:47 UTC] mike@php.net
What pecl_http version, and which libcurl version is exactly linked to php?
 [2008-11-22 09:15 UTC] mike@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2008-12-04 13:11 UTC] joshsnyder at earthlink dot net
I am also experiencing this.

Curl version:
curl 7.17.1 (i386-apple-darwin9.0.0) libcurl/7.17.1 OpenSSL/0.9.7l zlib/1.2.3

Pecl_http version:
pecl_http 1.6.1   stable

Subsecond timeouts would be very helpful to have.
 [2008-12-05 07:05 UTC] mike@php.net
Thank you for taking the time to write to us, but this is not
a bug.

Sub-second timeouts needs libcurl built with (c-)ares support.
See http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTTIMEOUTMS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC