ID: 42467
User updated by: daniel dot buschke at nextiraone dot de
Reported By: daniel dot buschke at nextiraone dot de
Status: Wont fix
Bug Type: Streams related
Operating System: Linux
PHP Version: 5CVS-2007-08-29 (snap)
New Comment:
DOH! Just setting this bug from Feedback to Wont Fix without answers is
not fine!
Previous Comments:
------------------------------------------------------------------------
[2007-08-29 12:11:56] daniel dot buschke at nextiraone dot de
Ok, there are some things:
1. fsockopen is using a blocking socket, isn't it?
2. I told, that fsockopen is using the same functions as ssh2_*()
If you want to use ssh2 functionallity you have the same problem:
--------------------------------------------
webserver_dev sandbox # cat ssh.php
<?php
$ssh_con = ssh2_connect('84.38.64.78');
$fingerprint = ssh2_fingerprint($ssh_con, SSH2_FINGERPRINT_MD5 |
SSH2_FINGERPRINT_HEX);
echo $fingerprint
?>
webserver_dev sandbox # socksify php -f ssh.php
PHP Warning: ssh2_connect(): Unable to connect to 84.38.64.78 on port
22 in /www/vhosts/dev/sandbox/ssh.php on line 3
PHP Warning: ssh2_connect(): Unable to connect to 84.38.64.78 in
/www/vhosts/dev/sandbox/ssh.php on line 3
PHP Warning: ssh2_fingerprint() expects parameter 1 to be resource,
boolean given in /www/vhosts/dev/sandbox/ssh.php on line 4
--------------------------------------------
Please try this script with you own ssh server. My will drop you if you
try!
So, this is a bug of ssh2 from pecl, because they are using that
"quick'n'dirty socket stuff"?!
------------------------------------------------------------------------
[2007-08-29 11:50:16] [EMAIL PROTECTED]
And as fsockopen() is meant for quick'n'dirty socket stuff and does
work in normal situation -> wont fix. You have a very special case and
thus you need to use the lower level functions.
------------------------------------------------------------------------
[2007-08-29 11:48:28] [EMAIL PROTECTED]
EINPROGRESS is quite normal error when you have non-blocking socket. I
guess this sockify thing messes this.
------------------------------------------------------------------------
[2007-08-29 11:45:48] daniel dot buschke at nextiraone dot de
here is the test script that shows that socket_create and
socket_connect is working:
webserver_dev sandbox # cat socks.php
<?php
define('TCP', 6);
$sock = socket_create(AF_INET, SOCK_STREAM, TCP);
socket_connect($sock, '69.147.83.196', 80);
socket_send($sock, "GET /\n", strlen('GET / HTTP 1.0'), 0);
echo socket_read($sock, 100);
socket_close($sock);
?>
webserver_dev sandbox # socksify php -f socks.php
This document is located <a href="/viewvc.cgi/">here</a>.
------------------------------------------------------------------------
[2007-08-29 11:43:16] daniel dot buschke at nextiraone dot de
webserver_dev sandbox # cat fsockopen_timeout.php
<?php
fsockopen('69.147.83.196', 80, $errno, $errstr, 30);
echo "errno: $errno\n";
echo "errstr: $errstr\n";
?>
webserver_dev sandbox # socksify php -f fsockopen_timeout.php
PHP Warning: fsockopen(): unable to connect to 69.147.83.196:80
(Operation now in progress) in
/www/vhosts/dev/sandbox/fsockopen_timeout.php on line 2
errno: 115
errstr: Operation now in progress
of curse it is equal to '1.2.3.4', 99
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/42467
--
Edit this bug report at http://bugs.php.net/?id=42467&edit=1