1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Allow filtered streams to be casted as fd for select

This removes the artificial limitation that is not necessary. The fact
that some streams can have some data buffered is not a problem because
the similar situation is already present for OpenSSL streams where
OpenSSL can internally buffer data for the unprocessed part of the
record.

Closes GH-20540
This commit is contained in:
Jakub Zelenka
2025-11-20 17:18:35 +01:00
parent 241e43f2d8
commit e49be5f8e2
5 changed files with 94 additions and 1 deletions

View File

@@ -297,7 +297,7 @@ PHPAPI zend_result _php_stream_cast(php_stream *stream, int castas, void **ret,
}
}
if (php_stream_is_filtered(stream)) {
if (php_stream_is_filtered(stream) && castas != PHP_STREAM_AS_FD_FOR_SELECT) {
if (show_err) {
php_error_docref(NULL, E_WARNING, "Cannot cast a filtered stream on this system");
}