[WIP]Make the FTP extension coroutine-enabled #20299
Closed
+19
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello everyone, I plan to add coroutine support for FTP in Swoole. However, in the current FTP implementation, the use of
pollis hardcoded, which lacks flexibility and makes it impossible to coroutine-enable FTP in Swoole. Therefore, I have made the following modifications to themy_pollfunction inftp.c:php_pollfd_for_mswith a function pointer namedphp_ftp_pollfd_for_ms.php_pollfd_for_msimplementation by default, ensuring the existing synchronous logic remains unaffected.This modification does not affect the original FTP logic and introduces no syntactic changes.
With this change, I can easily assign a value to
php_ftp_pollfd_for_msin my own extension, enabling coroutine support for FTP without any disruptive intrusions into the FTP code.swoole pr:swoole/swoole-src#5899