Bug #65137 [Com]: stream_select misleads when TLS socket is used

From: Date: Fri, 06 Mar 2015 01:15:14 +0000
Subject: Bug #65137 [Com]: stream_select misleads when TLS socket is used
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191201@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65137&edit=1

 ID:                 65137
 Comment by:         boen dot robot at gmail dot com
 Reported by:        boen dot robot at gmail dot com
 Summary:            stream_select misleads when TLS socket is used
 Status:             Re-Opened
 Type:               Bug
 Package:            Streams related
 Operating System:   Windows Server 2008 R2
 PHP Version:        5.5.0
 Assigned To:        rdlowrey
 Block user comment: N
 Private report:     N

 New Comment:

Thank you.

I don't have the setup (or know-how) to compile PHP myself, especially on Windows. If there
were snapshot builds, I'd gladly test this, as well as the related #68853.

I guess I'll just have to wait for... 5.6.8 or whenever a release with that fix in it emerges,
and report back then, if there are new issues.
(Considering how long this has been an issue, I don't mind...)


Previous Comments:
------------------------------------------------------------------------
[2015-03-06 01:02:35] rdlowrey@php.net

I have cherry-picked @DaveRandom's original SSL_pending() solution back into 5.6 and master.
I'm fairly certain this commit solves the problem fully. It was unfortunately reverted due to
its close proximity to some other buggy shenanigans.

This change will *not* appear in the forthcoming 5.6.7 release so that we have time to test, get
feedback and verify that it works everywhere. If you're interested in this bug's
resolution please build the current PHP-5.6 or master branch to verify that the issue is resolved.

------------------------------------------------------------------------
[2015-02-09 19:28:06] requinix@php.net

https://github.com/php/php-src/commit/7b8222aa44bbab9928afd57adb1bc04cf291d46c

------------------------------------------------------------------------
[2015-02-09 13:38:58] sjaillet at gmail dot com

Is it possible have the status of this bug updated ? Thanks !

------------------------------------------------------------------------
[2014-12-22 14:00:41] boen dot robot at gmail dot com

I'd like to point out that this issue is still not resolved, as daverandom's fix was
reverted due to the related issue askalski points to.

(So... the status shouldn't really be "Closed"...)

IMHO, that fix, while POTENTIALLY bad for performance (in SOME cases...), is better than no fix at
all, because encrypted sockets are almost impossible to work with otherwise. When people use an
encrypted connection, they are ready to sacrifice a little performance anyway.

A proper fix, I think, would involve a modification in PHP's stream API, where instead of just
PHP_STREAM_AS_FD_FOR_SELECT, there would be PHP_STREAM_AS_FD_FOR_SELECT_READ,
PHP_STREAM_AS_FD_FOR_SELECT_WRITE and PHP_STREAM_AS_FD_FOR_SELECT_OOB, allowing the OpenSSL
extension (and potentially other streams) to flush the appropriate buffers, as opposed to
"all" buffers, which is what the current fix is doing. The PHP_STREAM_AS_FD_FOR_SELECT
constant could be modified to be a bitmask that OR's all those new ones, thus minimizing
migration problems.

------------------------------------------------------------------------
[2014-10-02 17:05:15] askalski at synacor dot com

Related To: Bug #41631

------------------------------------------------------------------------


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

    https://bugs.php.net/bug.php?id=65137


--
Edit this bug report at https://bugs.php.net/bug.php?id=65137&edit=1


Thread (19 messages)

« previous php.bugs (#191201) next »