[php-src] PR #20298: Make the FTP extension coroutine-enabled
| From: | NathanFreeman | Date: | Sun, 26 Oct 2025 04:44:06 +0000 |
| Subject: | [php-src] PR #20298: Make the FTP extension coroutine-enabled | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-33812@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/20298
Author: NathanFreeman
Hello everyone, I would like to add coroutine support for the FTP extension in my own extension.
This PR modifies the
my_poll function in ftp.c with the following specific
changes:
1. The originally directly called php_pollfd_for_ms has been replaced with a function pointer
php_ftp_pollfd_for_ms.
2. During extension initialization, this pointer is by default set to the original php_pollfd_for_ms
implementation to preserve the existing synchronous logic.
3. When running in a coroutine environment, this function pointer can be replaced with a
coroutine-compatible polling function (e.g., a non-blocking version based on an event loop),
enabling FTP socket operations without blocking the main thread.