From: vnegrier at esds dot com
Operating system: Linux 2.4
PHP version: 5.0.2
PHP Bug Type: Sockets related
Bug description: STREAM_CLIENT_ASYNC_CONNECT not working (fix included)
Description:
------------
STREAM_CLIENT_ASYNC_CONNECT is not working due to two small bugs in the
same line of code ...
First STREAM_XPORT_OP_CONNECT_ASYNC is tested instead of
STREAM_XPORT_CONNECT_ASYNC, and the return value of
php_stream_xport_connect is non-zero (it's 1 actually) for a non blocking
pending connect().
Line 142 of main/streams/transports.c reads :
if (0 != php_stream_xport_connect(stream, name, namelen,
flags & STREAM_XPORT_OP_CONNECT_ASYNC ? 1 :
0,
timeout, &error_text, error_code TSRMLS_CC))
{
but it works well when I replace it with :
if (0 > php_stream_xport_connect(stream, name, namelen,
flags & STREAM_XPORT_CONNECT_ASYNC ? 1 : 0,
timeout, &error_text, error_code TSRMLS_CC))
{
--
Edit bug report at http://bugs.php.net/?id=30387&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30387&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30387&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30387&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=30387&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=30387&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=30387&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=30387&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=30387&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=30387&r=support
Expected behavior: http://bugs.php.net/fix.php?id=30387&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=30387&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=30387&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=30387&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30387&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=30387&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=30387&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=30387&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=30387&r=float
MySQL Configuration Error: http://bugs.php.net/fix.php?id=30387&r=mysqlcfg