ID: 31966
User updated by: james-php at bytehosting dot com
Reported By: james-php at bytehosting dot com
Status: Open
Bug Type: *Network Functions
Operating System: linux
PHP Version: 4.3.10
New Comment:
Too late of night, the previous comment was ment to say (I made an
error when submitting the bug). I do have it properly set as
stream_set_blocking($fd,FALSE); and the problem still exists. The code
sample submitted was wrong, the bug applies when you actully use the
proper function names. Thats what I get when re-typing the code out in
the form, instead of pasting it.
~james
Previous Comments:
------------------------------------------------------------------------
[2005-02-14 11:20:23] james-php at bytehosting dot com
opps -- stream_set_blocking()
~james
------------------------------------------------------------------------
[2005-02-14 11:15:36] james-php at bytehosting dot com
Description:
------------
When php is compiled against openssl. If you use a non_blocking stream
PHP does not obet the non_blocking options. If you REMOVE the ssl://
and connect to a non-secure port, and it works perfectly fine.
OpenSSL 0.9.7e
PHP 4.3.10 (cgi-fcgi) (built: Dec 27 2004 04:01:15)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
Kernel: 2.4.22-36mdkenterprise
Mandrake Linux release 9.2 (FiveStar) for i586
Dual xeon + hyperthreading:
model name : Intel(R) Xeon(TM) CPU 2.40GHz
stepping : 9
cpu MHz : 2389.117
cache size : 512 KB
./configure --enable-fastcgi --with-mysql --enable-aspell --enable-ftp
--enable-xml --enable-trans-sid --enable-curl \
--enable-force-cgi-redirect --with-gd --with-zlib-dir
--with-curl=/usr/include/curl --with-openssl \
--with-openssl-dir=/usr/compile/openssl-0.9.7e
Reproduce code:
---------------
<?
$fd = fsockopen("ssl://server.com","5557");
set_stream_blocking($fd,FALSE);
$buff = fgets($fd);
echo "You will never see this, as fgets hangs forever.";
?>
Expected result:
----------------
Socket to be non-blocked, and return immediately.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31966&edit=1