Work around write chunk size for TLS streams for PHP < 7.1.4#114
Work around write chunk size for TLS streams for PHP < 7.1.4#114WyriHaximus merged 1 commit intoreactphp:masterfrom
Conversation
src/Connection.php
Outdated
| // affected versions. Please update your PHP version. | ||
| // This applies to all streams because TLS may be enabled later on. | ||
| // See https://github.com/reactphp/socket/issues/105 | ||
| $limitWriteChunks = (PHP_VERSION_ID < 70018 || (PHP_VERSION_ID < 70114 && PHP_VERSION_ID >= 70100)); |
There was a problem hiding this comment.
That should be PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70114 for better readability IMO.
There was a problem hiding this comment.
Unfortunately this does not match the same version range. The fix landed in PHP 7.1.14 and PHP 7.0.18, which means that all earlier versions are affected (such as 7.1.13 and 7.0.17, but not 7.0.19)
There was a problem hiding this comment.
Yes, sure, just talking about the second condition being switched.
PHP_VERSION_ID < 70018 || PHP_VERSION_ID >= 70100 && PHP_VERSION_ID < 70114
There was a problem hiding this comment.
I don't think either version is any clearer, so I've just updated this to match your suggestion
👍
|
Wait a moment, typo'd the version, this has been fixed in PHP 7.1.4, not PHP 7.1.14… |
|
Sorry for the confusion, PR updated to reference affected PHP < 7.1.4 now See also #105 and php/php-src@17e9fc9 |
|
|
PHP < 7.1.4 (and PHP < 7.0.18) suffers from a bug when writing big chunks of data over TLS streams at once. We try to work around this by limiting the write chunk size to 8192 bytes for older PHP versions only. This is only a work-around and has a noticable performance penalty on affected versions. Please update your PHP version.
Closes / resolves #105