|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56377 stream_set_timeout() doesn't work
Submitted: 2005-04-21 09:55 UTC Modified: 2012-06-19 18:24 UTC
From: spookyfish at tweakdsl dot nl Assigned: langemeijer (profile)
Status: Closed Package: ssh2 (PECL)
PHP Version: 5_0 CVS-2005-04-21 (dev) OS: SuSE 9.0
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: spookyfish at tweakdsl dot nl
New email:
PHP Version: OS:


 [2005-04-21 09:55 UTC] spookyfish at tweakdsl dot nl
stream_set_timeout() doesn't seem to work on a blocking ssh2_exec() stream.

Reproduce code:
$con=ssh2_connect('ssss', 22);
ssh2_auth_password($con, "xxx", "yyy");
$exec = ssh2_exec($con, '/path/to/application');
$a = microtime(TRUE);
stream_set_blocking($exec, TRUE);
stream_set_timeout($exec, 1);
$buffer = trim(fgets($exec));
if (empty($buffer)) {
	$buffer = "EMPTY";
echo "Result: $buffer in " . round((microtime(TRUE) - $a)*1000, 1) . "ms";

Expected result:
EMPTY after ~ sec

Actual result:
Example code will stall >1 sec if the executable executes a sleep(10);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-06-10 19:42 UTC] casper at langemeijer dot eu
I'm working on getting this fixed. For a clean solution, this requires a change 
in the libssh2 library. I've sent them a patch and we'll see what the outcome 
will be.
 [2012-06-13 18:55 UTC]
-Assigned To: +Assigned To: langemeijer
 [2012-06-19 18:13 UTC]
Automatic comment from SVN on behalf of langemeijer
Log: Add support for stream_set_timeout() to channel streams - Fixes bug #56377
 [2012-06-19 18:24 UTC]
-Status: Assigned +Status: Closed
 [2012-06-19 18:24 UTC]
This issue is fixed in SVN, the change in libssh2 was not required.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 14:01:25 2023 UTC