|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58890 cast connection to select'able stream
Submitted: 2009-10-12 08:20 UTC Modified: -
Avg. Score:3.5 ± 0.5
Reproduced:0 of 0 (0.0%)
From: juzna dot cz at gmail dot com Assigned:
Status: Open Package: ssh2 (PECL)
PHP Version: 5.3.0RC4 OS: Ubuntu 64bit
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-10-12 08:20 UTC] juzna dot cz at gmail dot com
In standard implementation, the resource returned from ssh2_connect() is not possible to pass to stream_select() function, which makes it impossible to implement some kind of applications.

In my app, I need to open several streams and select() them for data to read. When new data available, I'll read them and process them.

I've programmed function ssh2_get_stream() which gets selectable stream from connection resource. It is available on

But it makes PHP seg fault when PHP finishes and frees memmory. I dont know how to solve it, maybe someone who understand it better could do it.

Thanks for any reply


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-12-04 09:46 UTC] samuel dot roze at gmail dot com
That is a functional patch:

When defining a stream ops, you MUST define the read, write, close and flush methods. Actually, in this way you can just define the close method.

Note: Is isn't working very well (the expected results are not mine, and you?) and, in my mind, it is a bad idea to select() on the result of ssh2_connect but it must be more interesting on an SSH2 Stream, returned by the ssh2_shell function. I'm working on that.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 17:01:27 2024 UTC