|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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/)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 24 14:00:02 2025 UTC |
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)); ?>