github swoole/swoole-src v6.3.0-rc1

pre-release7 hours ago

✨ New Features

  • Windows Support: Swoole now supports use on Windows. @matyhtf
  • New Swoole\Table Interfaces: Added add() (insert a new row only when the key does not exist), update() (update only when the key exists), cmpset() (compare and swap), cmpdel() (compare and delete), and getdel() (get and delete, supporting snapshots of an entire row or a single field). @binaryfire
  • ARM64 BTI Support: Added BTI (Branch Target Identification) support to the Boost.Context assembly files for ARM64 (AArch64). @NathanFreeman
  • PHP 8.4 PDO Subclass Support: Added support for the driver-specific subclasses introduced for PDO in PHP 8.4: Pdo\Sqlite, Pdo\Mysql, Pdo\Pgsql, Pdo\Firebird, and Pdo\Odbc. @matyhtf
  • autoload Symbol Export: The original zend_autoload function pointer saved by Swoole has been changed from a static private variable to an exported symbol accessible via php_swoole_api.h, allowing third-party extensions to still call PHP's original autoload handler after Swoole hijacks autoload. @cheplv
  • Cross-Platform Atomic Wait/Wakeup Mechanism: Implemented an atomic wait/wakeup mechanism based on a shared memory registry for platforms without futex (Linux) or WaitOnAddress (Windows) (such as macOS and BSD), replacing the previous std::mutex approach and supporting cross-process waiting and timeouts. @matyhtf
  • Windows Atomic futex Implementation: Implemented sw_atomic_futex_wait / sw_atomic_futex_wakeup for the Windows platform—based on the WaitOnAddress / WakeByAddressSingle APIs, combined with a mutex + unordered_map to track waiters, supporting timeouts and correct wakeups. @matyhtf
  • HTTP/2 Multiplexing Client: Swoole library adds Swoole\Coroutine\Http2\MultiplexClient, an HTTP/2 client that can multiplex requests from multiple coroutines onto one shared connection. @tw2066
  • Redis ACL Authentication: Swoole library adds Swoole\Database\RedisConfig::withAuth(), which now accepts a [username, password] array in addition to a password string, for Redis ACL authentication. @catchem88
  • Coroutine curl Support for CURLOPT_PREREQFUNCTION: Swoole library supports the CURLOPT_PREREQFUNCTION option in the coroutine curl handler. On PHP versions that do not natively support this option, use the namespaced constants Swoole\Curl\CURLOPT_PREREQFUNCTION, Swoole\Curl\CURL_PREREQFUNC_OK, and Swoole\Curl\CURL_PREREQFUNC_ABORT. @lazerg
  • HTTP/2 Server Option: Swoole library supports the http2_max_headers server option, adding the new constant Swoole\Constant::OPTION_HTTP2_MAX_HEADERS. @NathanFreeman
  • SSH Host Key API: The coroutine-based ssh extension adds the ssh2_hostkey() function—a new API that exposes the negotiated server's raw host key and algorithm type, supporting precise TOFU storage and independent verification. @binaryfire
  • SHA-256 Fingerprint Support: Added the SSH2_FINGERPRINT_SHA256 flag while retaining the original MD5/SHA-1 default behavior. @binaryfire

🐛 Bug Fixes

  • Removed the duplicate server array field set in Swoole\Coroutine\Http\Server to avoid triggering assertion failures in debug builds. @cheplv
  • Fixed a logic error in the kernel version check when Swoole loads io_uring, which caused Linux kernels with a major version greater than 6 to be misjudged as too old. @lazerg
  • Fixed improper maintenance of the Swoole coroutine context chain (origin_ctx) that produced dangling pointers, causing occasional segfaults when a Worker parsed HTTP parameters. @matyhtf
  • Fixed a segfault caused by the uninitialized module global variable cli under a multi-threaded SAPI. @henderkes
  • Fixed an issue in ZTS (Zend Thread Safety) mode where, with static TSRM local storage caching enabled, Swoole global variable access could read the wrong thread cache. @cheplv
  • Fixed the handling of Content-Length when the Swoole HTTP/2 server builds response headers, with the core goal of preserving Content-Length explicitly set by the application and preventing it from being incorrectly overwritten or recalculated. @binaryfire
  • Fixed the incorrect return value semantics of stream_socket_shutdown() under the Swoole Runtime hook. @binaryfire
  • Fixed the initialization of SFTP directory streams by filling in the session and sftp pointers before the stream is exposed, giving them complete handle state like ordinary file streams. @binaryfire
  • Fixed resource ownership for the SFTP wrapper by registering the session before authentication, so every failure path releases the initialized Zend resources and attaches the subsystem to the owned session. @binaryfire
  • Fixed the release of temporary resources after one-off SFTP operations by calling zend_list_delete after operations such as stat and mutation, so SFTP references are no longer leaked. @binaryfire
  • Fixed sub-resource protection after session closure by introducing the shared php_ssh2_session_is_open() predicate, so channel, listener, public-key, and SFTP return normal failure values after the parent session is closed. @binaryfire
  • Fixed session liveness protection in destructors by skipping libssh2 calls when the parent session is already closed while still releasing Zend references and local bookkeeping to avoid crashes. @binaryfire
  • Fixed the default blocking state of channel by changing is_blocking from 0 to 1, consistent with normal PHP stream behavior. @binaryfire
  • Fixed the EOF inference logic of channel by changing bytes_read <= 0 to bytes_read == 0, so negative transfer errors are no longer misjudged as EOF. @binaryfire
  • Fixed sub-second timeout precision by passing per-stream timeouts directly to socket poll, preserving millisecond precision and preventing one channel from changing the shared session timeout. @binaryfire
  • Fixed the publication of channel-local stream metadata so that stream_get_meta_data() reflects the channel's own blocking, EOF, timeout, and other states. @binaryfire
  • Fixed error handling for SFTP file streams so that negative SFTP reads remain errors rather than EOF, and EOF only comes from zero-byte reads. @binaryfire
  • Fixed error handling for SFTP directory streams by using the three branches < 0, == 0, and > 0 to distinguish transfer errors, normal completion, and valid entries, with each result owning its own EOF state. @binaryfire
  • Fixed the arginfo for ssh2_forward_listen / ssh2_forward_accept by removing the invalid resource return type and parameter type declarations, correcting the inconsistency between the generated arginfo and the handwritten function table contract. @binaryfire
  • Fixed timeout support for ssh2_async_call by adding timeout and timeout_event parameters, passing the timeout during poll, and distinguishing whether the failure was caused by a timeout. @binaryfire
  • Fixed channel initialization in ssh2_forward_accept by adding the is_blocking = 1, timeout = 0, and timeout_event = false fields. @binaryfire
  • Fixed a request memory leak in Swoole\Redis\Server. @binaryfire
  • Fixed stream writes under the Swoole Runtime Hook incorrectly reporting partial writes as failures. @binaryfire
  • Fixed a commit addressing ownership issues with proc_open stream descriptors. @binaryfire
  • Fixed trailer being closed prematurely in HTTP/2 streaming responses. @binaryfire
  • Fixed the HTTP/2 server not releasing the session after a fatal request, causing a crash when the worker shuts down. @binaryfire
  • Fixed HTTP/2 sendfile loading the entire file at once by changing it to chunked streaming transmission. @binaryfire
  • Fixed incorrect interaction between Content-Length and compression handling in HTTP/2 responses. @matyhtf
  • Fixed the HTTP/2 Bomb security vulnerability (remote denial-of-service attack). @matyhtf @catchem88 @adrian Liunardo @NathanFreeman
  • Fixed incomplete/corrupted data still being sent to the task worker or pipe transport layer when PHP serialization fails, while preserving the original exception and correcting falsy return values being misjudged as no result. @binaryfire
  • Fixed ssh2_exec() prematurely publishing the "completed" state when stdout/stderr reached EOF (causing an incorrect exit code). @binaryfire
  • Fixed premature reading of native state during constructor and parameter parsing in Swoole\Table, Swoole\Lock, Swoole\Coroutine\Lock, Swoole\Thread\Lock, Swoole\Thread\Barrier, Swoole\Process, and Swoole\Server, changing it to check native state only after Zend parameter parsing is complete, preventing object state corruption when PHP 8 scalar type conversion diagnostics trigger user code reentrancy. @binaryfire
  • Fixed resource leaks and duplicate listener replacement in Swoole\ProcessPool when setting up the listening socket fails. @matyhtf @binaryfire
  • Fixed MessageBus internal buffers incorrectly using an external allocator for allocation, which could cause a coredump on release. @matyhtf
  • Fixed an issue in Swoole ZTS where, after setting PHP_STREAM_FLAG_NO_CLOSE to prevent stdio from being closed prematurely, fds were not automatically closed at thread exit, causing file descriptor leaks. @matyhtf @binaryfire @NathanFreeman
  • Fixed WebSocket frame parsing not rejecting control frames (CLOSE/PING/PONG) with the RSV1 bit set. @matyhtf @binaryfire
  • Fixed target hostname length validation in SOCKS5 proxy DNS tunnel mode. @matyhtf @binaryfire
  • Fixed a memory leak where, when reactor initialization failed, only an error code was returned without deleting the already allocated reactor object. @matyhtf @binaryfire
  • Fixed Swoole Runtime hook not correctly reporting timeout status on read/write timeouts (ETIMEDOUT) and instead marking the stream as EOF. @matyhtf @binaryfire
  • Fixed Swoole\Thread::setPriority() not preserving the current scheduling policy when the policy parameter is omitted and instead using the invalid -1. @binaryfire
  • Fixed WebSocket ping() not reporting an error when encoding fails (such as when the payload exceeds the 125-byte control frame limit) and continuing to send an empty buffer. @binaryfire
  • Fixed Swoole library reporting fatal accept failures of \Swoole\Coroutine\Server through start() and errCode. @binaryfire
  • Fixed a memory leak in Swoole library's Swoole\RemoteObject\Client that had existed since 6.2.0. Previously, each client would remain alive for the entire lifetime of the process, so every hooked dns_get_record(), checkdnsrr(), getmxrr(), mail(), and gethostbyaddr() call, as well as every Swoole\MongoDB\Client, would leak a client, its HTTP client, and an open unix socket. Now, the client is released immediately when there are no users, so for clients that have disappeared, Swoole\RemoteObject\Client::getInstance() returns null; clients can also no longer be cloned. @deminy
  • Fixed keyboard-interactive authentication state isolation by moving the in-progress password from a process-global pointer to per-session abstract data, eliminating the risk of password cross-contamination between concurrent coroutines. @binaryfire
  • Fixed build configuration error handling by upgrading missing agent/session-timeout symbols from warnings to configuration errors, avoiding silently generating feature-reduced APIs when headers and libraries do not match. @binaryfire
  • Fixed SSH2 shell size parameters by correcting the handling of shell size parameters. @binaryfire
  • Fixed SSH2 environment variable iteration to ensure each key is correctly paired with its own value. @binaryfire
  • Fixed environment variable value masking by masking SSH2 environment variable values in warning messages. @binaryfire
  • Fixed exec PTY metadata by changing the pty parameter from bool to ?string, representing the remote terminal type. @binaryfire
  • Fixed recoverability for incomplete shell sizes by issuing a warning and returning false when only width is provided without height, and removing the unreachable return after the fatal error. @binaryfire
  • Fixed the issue in SWOOLE_THREAD mode where Swoole\Server could not start when the set() method was not called. @NathanFreeman
  • Fixed an issue where, after a hooked TLS stream completed the handshake in Socket::connect(), if that call failed or was canceled, the stream transport layer would still try to enable encryption again instead of directly returning failure. @binaryfire
  • Fixed HTTP compression using the wrong data format when returning deflate encoding. @lazerg
  • Fixed the issue where, when native hook was not enabled, destroying a native CurlHandle did not hand the object release work back to ext-curl, resulting in incorrect release logic. @matyhtf
  • Fixed cURL multi not correctly restoring the "readable and writable simultaneously" event mask in the CURL_POLL_INOUT state, causing HTTP/2 duplex transmission to be repeatedly woken up in a busy loop when blocked by flow control. @matyhtf
  • Fixed coroutine leaks caused by the peer closing the connection after send_yield is enabled, preventing the coroutine from being woken up. @NathanFreeman
  • Fixed incorrect read/write behavior for coroutine sockets with iouring enabled when SSL/TLS is enabled. @NathanFreeman
  • Fixed a null pointer dereference crash when querying port properties (ServerPortProperty) while a Swoole server is closing a port, caused by passing a NULL port pointer. @alt-program
  • Fixed incorrect parameter validation, incorrect error messages, and crashes when passing objects for SO_LINGER, SO_RCVTIMEO, and SO_SNDTIMEO in Swoole\Coroutine\Socket's setOption(). @binaryfire
  • Fixed an issue where calling Swoole\Process::signal() in onManagerStart when built with --enable-thread-context (SW_USE_THREAD_CONTEXT) caused the manager process to crash with SIGSEGV. @crazywhalecc

⚙️ Refactoring

  • A relatively large-scale refactoring of the AIO (asynchronous I/O) thread pool, with the core goals of enhancing safety and adding more observability metrics. @matyhtf
  • Optimized the logic for calculating the number of available CPUs for a Swoole process, mainly to make it aware of CPU affinity and cgroup limits rather than simply reading the total number of online CPUs in the system. @matyhtf
  • The option arrays and option lookups in Swoole library's Swoole\Server\Helper now use Swoole\Constant::OPTION_* constants instead of string literals. @deminy
  • Modernized the Swoole library codebase to adapt to PHP 8.2+ (constructor property promotion, readonly properties, first-class callable syntax, str_contains(), etc.), removing the remaining version compatibility code paths. Public constructor parameter names and non-final classes remain unchanged, so subclasses and named arguments still work correctly. @deminy

⚠ Notes

  • The stdext feature has been removed from this version.
  • Swoole v6.3.0-RC1 can only be used in a test environment and must not be used in a production environment.

🥮 Congratulations

On the occasion of the Mid-Autumn Festival, all of us at Swoole wish you: may the moon be full, people be reunited, and everything go perfectly; may the flowers be beautiful, the lanterns be bright, and every year be wonderful. Happy Mid-Autumn Festival, and may your family be happy!

✨️ 新特性

  • Windows 支持:Swoole 现已支持在 Windows 上使用。@matyhtf
  • Swoole\Table 新增接口:增加 add()(仅当 key 不存在时插入新行)、update()(仅当 key 存在时更新)、cmpset()(比较并交换)、cmpdel()(比较并删除)和 getdel()(获取并删除,支持整行或单字段快照)。@binaryfire
  • ARM64 BTI 支持:为 ARM64(AArch64)的 Boost.Context 汇编文件添加 BTI(Branch Target Identification) 支持。@NathanFreeman
  • PHP 8.4 PDO 子类支持:支持 PHP8.4 为 PDO 引入的驱动专属子类:Pdo\Sqlite、Pdo\Mysql、Pdo\Pgsql、Pdo\Firebird 和 Pdo\Odbc。@matyhtf
  • autoload 符号导出:Swoole 保存的原始 zend_autoload 函数指针从 static 私有变量改为可通过 php_swoole_api.h 访问的导出符号,让第三方扩展能在 Swoole 劫持 autoload 之后仍然调用到 PHP 原本的 autoload 处理器。@cheplv
  • 跨平台原子等待/唤醒机制:为没有 futex(Linux) 或 WaitOnAddress(Windows) 的平台(如 macOS、BSD)实现了一套基于共享内存注册表的原子等待/唤醒机制,替代原来的 std::mutex 方案,支持跨进程等待和超时。@matyhtf
  • Windows 原子 futex 实现:为 Windows 平台实现了 sw_atomic_futex_wait / sw_atomic_futex_wakeup——基于 WaitOnAddress / WakeByAddressSingle API,配合 mutex + unordered_map 跟踪等待者,支持超时和正确唤醒。@matyhtf
  • HTTP/2 多路复用客户端:Swoole library 新增 Swoole\Coroutine\Http2\MultiplexClient,这是一个 HTTP/2 客户端,可将多个协程的请求复用到一条共享连接上。@tw2066
  • Redis ACL 认证:Swoole library 新增 Swoole\Database\RedisConfig::withAuth(),现在除了接受密码字符串外,还接受 [username, password] 数组,用于 Redis ACL 认证。@catchem88
  • 协程 curl 支持 CURLOPT_PREREQFUNCTION:Swoole library 在协程 curl 处理器中支持 CURLOPT_PREREQFUNCTION 选项。在不原生支持该选项的 PHP 版本上,使用带命名空间的常量 Swoole\Curl\CURLOPT_PREREQFUNCTION、Swoole\Curl\CURL_PREREQFUNC_OK 和 Swoole\Curl\CURL_PREREQFUNC_ABORT。@lazerg
  • HTTP/2 服务端选项:Swoole library 支持 http2_max_headers 服务端选项,新增常量 Swoole\Constant::OPTION_HTTP2_MAX_HEADERS。@NathanFreeman
  • SSH 主机密钥 API:协程化的 ssh 扩展增加 ssh2_hostkey() 函数——新增暴露协商后服务器原始主机密钥及算法类型的 API,支持精确的 TOFU 存储与独立验证。@binaryfire
  • SHA-256 指纹支持:新增 SSH2_FINGERPRINT_SHA256 标志,同时保留原有 MD5/SHA-1 默认行为。@binaryfire

🐛 Bug 修复

  • 移除 Swoole\Coroutine\Http\Server 中重复设置的 server 数组字段,避免在 debug 构建下触发断言失败。@cheplv
  • 修复了 Swoole 加载 io_uring 时,内核版本检查中的一个逻辑错误,该错误会导致主版本号大于 6 的 Linux 内核被误判为版本过低。@lazerg
  • 修复了 Swoole 协程上下文链(origin_ctx)维护不当产生悬空指针,导致 Worker 解析 HTTP 参数时偶发段错误的问题。@matyhtf
  • 修复了 Swoole 在多线程 SAPI 下,由于模块全局变量 cli 未初始化而导致的段错误(segfault)。@henderkes
  • 修复了在 ZTS(Zend Thread Safety) 模式下启用静态 TSRM 本地存储缓存时,Swoole 全局变量访问可能读到错误线程缓存的问题。@cheplv
  • 修复了 Swoole HTTP/2 服务器在构建响应头时对 Content-Length 的处理逻辑,核心目标是保留应用显式设置的 Content-Length,避免被错误地覆盖或重算。@binaryfire
  • 修复了 Swoole Runtime 钩子(hook)下 stream_socket_shutdown() 的返回值语义错误。@binaryfire
  • 修复了 SFTP 目录流的初始化,在流暴露前补齐 session 和 sftp 指针,使其拥有和普通文件流一样的完整句柄状态。@binaryfire
  • 修复了 SFTP wrapper 的资源所有权,认证前先注册 session,让每条失败路径都释放已初始化的 Zend 资源,并把子系统挂到被拥有的 session 上。@binaryfire
  • 修复了一次性 SFTP 操作后临时资源的释放,在 stat 和 mutation 等操作后执行 zend_list_delete,不再泄漏 SFTP 引用。@binaryfire
  • 修复了会话关闭后的子资源保护,引入共享的 php_ssh2_session_is_open() 谓词,让 channel、listener、public-key、SFTP 在父会话关闭后返回正常失败值。@binaryfire
  • 修复了析构函数的会话存活保护,父会话已关闭时跳过 libssh2 调用,但仍释放 Zend 引用和本地记账,避免崩溃。@binaryfire
  • 修复了 channel 的默认阻塞状态,将 is_blocking 从 0 改为 1,与普通 PHP 流行为一致。@binaryfire
  • 修复了 channel 的 EOF 推导逻辑,把 bytes_read <= 0 改为 bytes_read == 0,不再把负的传输错误误判为 EOF。@binaryfire
  • 修复了 sub-second 超时精度,把每流超时直接传给 socket poll,保留毫秒精度,避免一个 channel 改掉共享 session 的超时。@binaryfire
  • 修复了 channel-local 流元数据的发布,让 stream_get_meta_data() 反映该 channel 自己的阻塞、EOF、超时等状态。@binaryfire
  • 修复了 SFTP 文件流的错误处理,负的 SFTP 读保持为错误而非 EOF,EOF 只来自零字节读。@binaryfire
  • 修复了 SFTP 目录流的错误处理,用 < 0、== 0、> 0 三种分支区分传输错误、正常完成和有效条目,每个结果自己拥有 EOF 状态。@binaryfire
  • 修复了 ssh2_forward_listen / ssh2_forward_accept 的 arginfo,去掉不合法的 resource 返回类型和参数类型声明,修正生成 arginfo 与手写函数表的契约不一致。@binaryfire
  • 修复了 ssh2_async_call 的超时支持,新增 timeout 和 timeout_event 参数,poll 时传超时并能区分是否是超时导致的失败。@binaryfire
  • 修复了 ssh2_forward_accept 的 channel 初始化,补上 is_blocking = 1、timeout = 0、timeout_event = false 字段。@binaryfire
  • 修复了 Swoole\Redis\Server 请求内存泄漏的问题。@binaryfire
  • 修复了 Swoole Runtime Hook 下流写入把部分写入(partial write)误报为失败的问题。@binaryfire
  • 修复了 proc_open 流描述符所有权问题的提交。@binaryfire
  • 修复了 HTTP/2 流式响应中 trailer 被提前关闭问题。@binaryfire
  • 修复了 HTTP/2 服务器在致命请求(fatal request)后会话未被释放,导致 worker 关闭时崩溃的问题。@binaryfire
  • 修复了 HTTP/2 sendfile 一次性加载整个文件的问题,改为分块流式发送。@binaryfire
  • 修复了 HTTP/2 响应中 Content-Length 与压缩处理之间的错误交互的问题。@matyhtf
  • 修复了 HTTP/2 Bomb 安全漏洞(远程拒绝服务攻击)。@matyhtf @catchem88 @adrian Liunardo @NathanFreeman
  • 修复了 PHP 序列化失败时,不完整/损坏的数据仍被发送到 task worker 或 pipe 传输层的问题,同时保留了原始异常、并纠正了 falsy 返回值被误判为无结果的问题。@binaryfire
  • 修复了 ssh2_exec() 在 stdout/stderr 到达 EOF 时就过早发布"完成"状态(导致退出码错误)的问题。@binaryfire
  • 修复了 Swoole\Table、Swoole\Lock、Swoole\Coroutine\Lock、Swoole\Thread\Lock、Swoole\Thread\Barrier、Swoole\Process、Swoole\Server 在构造函数和参数解析中过早读取原生状态的问题,改为在 Zend 参数解析完成之后再检查原生状态,防止 PHP 8 标量类型转换诊断触发用户代码重入时破坏对象状态。@binaryfire
  • 修复了 Swoole\ProcessPool 在监听 socket 设置失败时的资源泄漏、监听器重复替换问题。@matyhtf @binaryfire
  • 修复了 MessageBus 内部缓冲区错误地使用外部 allocator 分配、导致释放时可能 coredump 的问题。@matyhtf
  • 修复了 Swoole ZTS 在设置 PHP_STREAM_FLAG_NO_CLOSE 防止 stdio 提前关闭后,线程结束时 fd 不会被自动关闭、导致文件描述符泄漏的问题。@matyhtf @binaryfire @NathanFreeman
  • 修复了 WebSocket 帧解析未拒绝设置了 RSV1 位的控制帧(CLOSE/PING/PONG)的问题。@matyhtf @binaryfire
  • 修复了 SOCKS5 代理在 DNS 隧道模式下对目标主机名的长度校验。@matyhtf @binaryfire
  • 修复了 reactor 初始化失败时只返回错误码、却不删除已分配的 reactor 对象导致的内存泄漏的问题。@matyhtf @binaryfire
  • 修复了 Swoole Runtime hook 在读写超时(ETIMEDOUT)时未正确报告超时状态、反而把流标记为 EOF 的问题。@matyhtf @binaryfire
  • 修复了 Swoole\Thread::setPriority() 在省略 policy 参数时,没有保留当前调度策略、反而用无效的 -1 的问题。@binaryfire
  • 修复了 WebSocket ping() 在编码失败(如负载超过控制帧 125 字节上限)时未报告错误、继续发送空 buffer 的问题。@binaryfire
  • 修复了 Swoole library 通过 start() 和 errCode 报告 \Swoole\Coroutine\Server 的致命 accept 失败的问题。@binaryfire
  • 修复了 Swoole library 的 Swoole\RemoteObject\Client 中一个自 6.2.0 起就存在的内存泄漏。此前每个客户端都会在进程的整个生命周期内保持存活,因此每次被 hook 的 dns_get_record()、checkdnsrr()、getmxrr()、mail() 和 gethostbyaddr() 调用,以及每个 Swoole\MongoDB\Client,都会泄漏一个客户端、其 HTTP 客户端和一个打开的 unix socket。现在,当没有使用者时客户端会立即释放,因此对于已消失的客户端,Swoole\RemoteObject\Client::getInstance() 返回 null;客户端也不能再被克隆。@deminy
  • 修复了键盘交互式认证状态隔离,将进行中的密码从进程全局指针改存到每会话抽象数据,消除并发协程间密码串台的风险。@binaryfire
  • 修复了构建配置错误处理,将缺失 agent/session-timeout 符号从警告升级为配置错误,避免头文件与库不匹配时静默生成功能缩减的 API。@binaryfire
  • 修复了 SSH2 shell 尺寸参数,修正 shell 尺寸参数的处理。@binaryfire
  • 修复了 SSH2 环境变量迭代,确保每个键与其自身的值正确配对。@binaryfire
  • 修复了环境变量值脱敏,在警告信息中脱敏 SSH2 环境变量的值。@binaryfire
  • 修复了 exec PTY 元数据,将 pty 参数从 bool 改为 ?string,表示远程终端类型。@binaryfire
  • 修复了不完整 shell 尺寸可恢复,只提供宽度而未提供高度时发出警告并返回 false,移除致命错误后的不可达返回。@binaryfire
  • 修复了在 SWOOLE_THREAD 模式下,Swoole\Server 未调用 set() 方法时无法启动的问题。@NathanFreeman
  • 修复了被 Hook 的 TLS 流在 Socket::connect() 中完成握手后,若该调用失败或被取消,流传输层仍会再次尝试启用加密,而非直接返回失败的问题。@binaryfire
  • 修复了 HTTP 压缩在返回 deflate 编码时使用了错误数据格式的问题。@lazerg
  • 修复了未启用原生 hook 时,销毁原生 CurlHandle 未将对象释放工作交回 ext-curl,导致释放逻辑不正确的问题。@matyhtf
  • 修复了 cURL multi 在 CURL_POLL_INOUT 状态下未正确恢复"同时可读可写"事件掩码,导致 HTTP/2 双向传输(duplex)在流控阻塞时反复被唤醒、形成忙循环的问题。@matyhtf
  • 修复了开启 send_yield 后,对端关闭连接导致协程无法被唤醒,进而发生协程泄露的问题。@NathanFreeman
  • 修复了启用 iouring 的协程 socket 在启用 SSL/TLS 时读写行为不正确的问题。@NathanFreeman
  • 修复了 Swoole 服务器关闭端口时,查询端口属性(ServerPortProperty)因传入 NULL 端口指针而导致空指针解引用崩溃的问题。@alt-program
  • 修复了 Swoole\Coroutine\Socket 的 setOption() 在 SO_LINGER、SO_RCVTIMEO、SO_SNDTIMEO 上参数校验错误、错误信息有误以及传入对象时崩溃的问题。@binaryfire
  • 修复了以 --enable-thread-context(SW_USE_THREAD_CONTEXT)构建时,在 onManagerStart 中调用 Swoole\Process::signal() 会导致 manager 进程以 SIGSEGV 崩溃的问题。@crazywhalecc

⚙️ 重构

  • AIO(异步 I/O)线程池的一次较大规模重构,核心目标是增强安全性并增加更多可观测指标。@matyhtf
  • 优化了 Swoole 计算进程可用 CPU 数量的逻辑,主要是让它能感知 CPU 亲和性(affinity)和 cgroup 限制,而不是简单地读取系统在线 CPU 总数。@matyhtf
  • Swoole library 的 Swoole\Server\Helper 中的选项数组和选项查找现在使用 Swoole\Constant::OPTION_* 常量,而不是字符串字面量。@deminy
  • 对 Swoole library 代码库进行了现代化改造,适配 PHP 8.2+(构造函数属性提升、readonly 属性、一等可调用语法、str_contains() 等),移除了剩余的版本兼容代码路径。公开的构造函数参数名和非 final 类保持不变,因此子类和命名参数仍可正常工作。@deminy

⚠ 注意

  • stdext 特性已经从该版本移除。
  • Swoole v6.3.0-RC1 只能在测试环境使用,禁止在生产环境使用。

🥮 祝贺

值此中秋佳节,Swoole 全体同仁恭祝各位:月圆人圆事事圆,花好灯好年年好。愿中秋快乐,阖家幸福!

Don't miss a new swoole-src release

NewReleases is sending notifications on new releases.