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

From: Date: Fri, 06 Mar 2015 01:02:36 +0000
Subject: Bug #65137 [ReO]: stream_select misleads when TLS socket is used
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191199@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 Updated by: rdlowrey@php.net 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: 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. Previous Comments: ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ [2014-08-27 15:51:06] daverandom@php.net The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. ------------------------------------------------------------------------ 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

« previous php.bugs (#191199) next »