|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30387 STREAM_CLIENT_ASYNC_CONNECT not working (fix included)
Submitted: 2004-10-11 02:54 UTC Modified: 2004-10-11 03:39 UTC
From: vnegrier at esds dot com Assigned:
Status: Closed Package: Sockets related
PHP Version: 5.0.2 OS: Linux 2.4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
11 - 6 = ?
Subscribe to this entry?

 [2004-10-11 02:54 UTC] vnegrier at esds dot com
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)) {


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-10-11 03:11 UTC]
Please expand on why you think it is not working by providing a short script here.
 [2004-10-11 03:39 UTC]
Nevermind... it's nearly 3am here.
Fix going into CVS now.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Aug 11 08:05:57 2022 UTC