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

From: Date: Wed, 11 Mar 2015 12:35:54 +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-191309@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: arjen at react dot com Reported by: boen dot robot at gmail dot com Summary: stream_select misleads when TLS socket is used Status: Closed 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: This patch triggers this bug again: https://bugs.php.net/bug.php?id=67965 Previous Comments: ------------------------------------------------------------------------ [2015-03-08 07:52:31] boen dot robot at gmail dot com Related To: Bug #68853 ------------------------------------------------------------------------ [2015-03-08 06:56:59] boen dot robot at gmail dot com The snapshot build seems to have fixed the original issue I was encountering, but it seems it might have created a new one... Or maybe this one existed already, and I just hadn't managed witness it before. Again only on an encrypted connection... If the server waits for more than default_socket_timeout before starting to receiving data, while in the mean time the client does a stream_select() with the connection in $w (i.e. it waits for the server to be ready to receive... supposedly), and $tv_sec being NULL, stream_select() just hangs at the client, and thus no sending is ever done. Though for some reason, I can't duplicate it by modifying the echo client/server pair from bug #68853 accordingly... Feel free to close this particular issue. I'll create a new one if I can produce a more reliable test case than my current (somewhat large) original code that exhibits this new issue. ------------------------------------------------------------------------ [2015-03-06 17:35:39] rdlowrey@php.net Windows snapshots should be available sometime in the next few hours here: http://windows.php.net/downloads/snaps/php-5.6/ The commit to fix this was added after the final March 05 snapshot. As soon as a newer snapshot is available you should be able to download a usable windows binary to test. In my own tests this latest commit resolves the issue from the client/server test case in the related bug #68853. ------------------------------------------------------------------------ [2015-03-06 01:15:13] boen dot robot at gmail dot com 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...) ------------------------------------------------------------------------ [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. ------------------------------------------------------------------------ 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 (#191309) next »