- No longer throw warnings when failing to set the
socketreceive/send buffer size - Fixed an issue in
Swoole\Http\Serverwhere theonClosecallback might execute beforeonRequestwhen handlingHTTP2requests, leading to a use-after-free problem - Optimized the
getSocket()method by duplicating the file descriptor when exporting thephp socketsresource object, preventingphp socketsfrom affecting thesocketheld bySwooleupon closure - Fixed a memory leak issue in
Swoole\Async\Client - Fixed an issue where
Swoole\Coroutine\Http\ClientofIPv6type could not useSocks5proxy - Synchronized updates to adapt to relevant changes in the
CURLextension inPHP 8.4 - Added the
async.file://file protocol, which allows enabling coroutine scheduling for specific file operations even when global file coroutine support is disabled
use function Swoole\Coroutine\run;
// Disable global file coroutine support but enable coroutine operations for specific files via the `async.file://` protocol
Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL & ~SWOOLE_HOOK_FILE);
run(function() {
$fp = fopen("async.file:///home/test", "r");
fwrite($fp, "data");
fclose($fp);
$content = file_get_contents("async.file:///home/test.txt");
});This feature is designed for scenarios where global file system coroutine HOOK is disabled, but asynchronous read/write scheduling is required for specific file operations.
简体中文
- 设置
socket接收/发送缓冲区尺寸失败时不再抛出警告 - 修复
Swoole\Http\Server处理HTTP2请求时,onClose回调可能先于onRequest执行,导致释放后使用(use-after-free)的问题 - 优化
getSocket()方法,导出php sockets资源对象时复制文件描述符,避免php sockets关闭时影响Swoole持有的socket - 修复
Swoole\Async\Client内存泄漏问题 - 修复
IPv6类型Swoole\Coroutine\Http\Client无法使用Socks5代理的问题 - 同步适配
PHP 8.4中CURL扩展的相关更新 - 新增
async.file://文件协议,支持在未开启全局文件协程化时,对指定文件操作启用协程调度
use function Swoole\Coroutine\run;
// 禁用全局文件协程化,但可通过 `async.file://` 协议对特定文件启用协程操作
Swoole\Runtime::enableCoroutine(SWOOLE_HOOK_ALL & ~SWOOLE_HOOK_FILE);
run(function() {
$fp = fopen("async.file:///home/test", "r");
fwrite($fp, "data");
fclose($fp);
$content = file_get_contents("async.file:///home/test.txt");
});该特性用于在禁用全局文件系统协程 HOOK后,对部分文件操作进行异步读写调用的场景。