Hello PECL team,

I have a potential bug report and a related question on the SSH2
extension (version 0.13, PHP 5.4).

The environment in which I'm using the SSH2 extension is such that
connection to the target machine can be dropped at any time. I send
multiple automated requests that log in to the server using the SSH2
extension (once every few seconds - that's by design) and so I expect
to be able to set a reasonable timeout for such requests. Since a) the
SSH access routine is automated (i.e., performed by PHP running on the
web server) and b) the connection can be dropped at any time, I'm
testing connection drops between any two successive function calls in
my routine.

So this bug report is about the following situation:

- ssh2_connect() succeeds and returns a resource,
- connection drops (the server goes into a reboot for example),
- then ssh2_auth_password() is called and hangs until the server
becomes available again, with a waiting period in the order of one
minute (which is how fast the server comes back online).

If I drop the connection between ssh2_auth_password() and ssh2_sftp(),
then ssh2_sftp() returns false in a few seconds. The other PHP file
functions - to be precise, opendir(), readdir(), stat() - return false
immediately if called on an sftp descriptor that points to a dropped
connection. Thus, ssh2_auth_password() is the odd one in this list.

Furthermore, I can't seem to control the timeout for
ssh2_auth_password() using the 'default_socket_timeout' PHP parameter.
is it possible to control that timeout at all at runtime? if yes, how
exactly?

PHP version: 5.4.16-45.el17
PECL SSH2 version: 0.13, built from source using the EPEL source rpm
php-pecl-ssh2-0.12-1.el7 (since in EPEL only 0.12 is available, I've
taken that source rpm and rebuilt using the new tarball).
libssh2 version: 1.4.3-10.e7-2.1
OS: CentOS 7.0.1406 (Core)

-- 
-- Best regards,
Ignat Semenov

-- 
PECL development discussion Mailing List (http://pecl.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to