✨ New Features
- Windows Support:
Swoolenow supports use onWindows. @matyhtf - New
Swoole\TableInterfaces: Addedadd()(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), andgetdel()(get and delete, supporting snapshots of an entire row or a single field). @binaryfire - ARM64 BTI Support: Added
BTI (Branch Target Identification)support to theBoost.Contextassembly files forARM64(AArch64). @NathanFreeman - PHP 8.4 PDO Subclass Support: Added support for the driver-specific subclasses introduced for
PDOinPHP 8.4:Pdo\Sqlite,Pdo\Mysql,Pdo\Pgsql,Pdo\Firebird, andPdo\Odbc. @matyhtf - autoload Symbol Export: The original
zend_autoloadfunction pointer saved bySwoolehas been changed from astaticprivate variable to an exported symbol accessible viaphp_swoole_api.h, allowing third-party extensions to still callPHP's originalautoloadhandler afterSwoolehijacksautoload. @cheplv - Cross-Platform Atomic Wait/Wakeup Mechanism: Implemented an atomic wait/wakeup mechanism based on a shared memory registry for platforms without
futex (Linux)orWaitOnAddress (Windows)(such asmacOSandBSD), replacing the previousstd::mutexapproach and supporting cross-process waiting and timeouts. @matyhtf - Windows Atomic futex Implementation: Implemented
sw_atomic_futex_wait/sw_atomic_futex_wakeupfor the Windows platform—based on theWaitOnAddress/WakeByAddressSingleAPIs, combined with a mutex + unordered_map to track waiters, supporting timeouts and correct wakeups. @matyhtf - HTTP/2 Multiplexing Client:
Swoole libraryaddsSwoole\Coroutine\Http2\MultiplexClient, anHTTP/2client that can multiplex requests from multiple coroutines onto one shared connection. @tw2066 - Redis ACL Authentication:
Swoole libraryaddsSwoole\Database\RedisConfig::withAuth(), which now accepts a[username, password]array in addition to a password string, forRedis ACLauthentication. @catchem88 - Coroutine curl Support for
CURLOPT_PREREQFUNCTION:Swoole librarysupports theCURLOPT_PREREQFUNCTIONoption in the coroutinecurlhandler. OnPHPversions that do not natively support this option, use the namespaced constantsSwoole\Curl\CURLOPT_PREREQFUNCTION,Swoole\Curl\CURL_PREREQFUNC_OK, andSwoole\Curl\CURL_PREREQFUNC_ABORT. @lazerg - HTTP/2 Server Option:
Swoole librarysupports thehttp2_max_headersserver option, adding the new constantSwoole\Constant::OPTION_HTTP2_MAX_HEADERS. @NathanFreeman - SSH Host Key API: The coroutine-based
sshextension adds thessh2_hostkey()function—a new API that exposes the negotiated server's raw host key and algorithm type, supporting preciseTOFUstorage and independent verification. @binaryfire - SHA-256 Fingerprint Support: Added the
SSH2_FINGERPRINT_SHA256flag while retaining the original MD5/SHA-1 default behavior. @binaryfire
🐛 Bug Fixes
- Removed the duplicate
serverarray field set inSwoole\Coroutine\Http\Serverto avoid triggering assertion failures indebugbuilds. @cheplv - Fixed a logic error in the kernel version check when
Swooleloadsio_uring, which causedLinuxkernels with a major version greater than6to be misjudged as too old. @lazerg - Fixed improper maintenance of the
Swoolecoroutine context chain (origin_ctx) that produced dangling pointers, causing occasional segfaults when aWorkerparsedHTTPparameters. @matyhtf - Fixed a segfault caused by the uninitialized module global variable
cliunder a multi-threadedSAPI. @henderkes - Fixed an issue in
ZTS (Zend Thread Safety)mode where, with staticTSRMlocal storage caching enabled,Swooleglobal variable access could read the wrong thread cache. @cheplv - Fixed the handling of
Content-Lengthwhen theSwoole HTTP/2server builds response headers, with the core goal of preservingContent-Lengthexplicitly 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 theSwoole Runtimehook. @binaryfire - Fixed the initialization of
SFTPdirectory streams by filling in thesessionandsftppointers before the stream is exposed, giving them complete handle state like ordinary file streams. @binaryfire - Fixed resource ownership for the
SFTP wrapperby registering thesessionbefore authentication, so every failure path releases the initialized Zend resources and attaches the subsystem to the ownedsession. @binaryfire - Fixed the release of temporary resources after one-off
SFTPoperations by callingzend_list_deleteafter operations such asstatandmutation, 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, sochannel,listener,public-key, andSFTPreturn normal failure values after the parent session is closed. @binaryfire - Fixed session liveness protection in destructors by skipping
libssh2calls when the parent session is already closed while still releasingZendreferences and local bookkeeping to avoid crashes. @binaryfire - Fixed the default blocking state of
channelby changingis_blockingfrom0to1, consistent with normalPHPstream behavior. @binaryfire - Fixed the
EOFinference logic ofchannelby changingbytes_read <= 0tobytes_read == 0, so negative transfer errors are no longer misjudged asEOF. @binaryfire - Fixed
sub-secondtimeout precision by passing per-stream timeouts directly tosocket poll, preserving millisecond precision and preventing onechannelfrom changing the sharedsessiontimeout. @binaryfire - Fixed the publication of
channel-localstream metadata so thatstream_get_meta_data()reflects thechannel's own blocking,EOF, timeout, and other states. @binaryfire - Fixed error handling for
SFTPfile streams so that negativeSFTPreads remain errors rather thanEOF, andEOFonly comes from zero-byte reads. @binaryfire - Fixed error handling for
SFTPdirectory streams by using the three branches< 0,== 0, and> 0to distinguish transfer errors, normal completion, and valid entries, with each result owning its ownEOFstate. @binaryfire - Fixed the
arginfoforssh2_forward_listen/ssh2_forward_acceptby removing the invalidresourcereturn type and parameter type declarations, correcting the inconsistency between the generatedarginfoand the handwritten function table contract. @binaryfire - Fixed timeout support for
ssh2_async_callby addingtimeoutandtimeout_eventparameters, passing the timeout duringpoll, and distinguishing whether the failure was caused by a timeout. @binaryfire - Fixed
channelinitialization inssh2_forward_acceptby adding theis_blocking = 1,timeout = 0, andtimeout_event = falsefields. @binaryfire - Fixed a request memory leak in
Swoole\Redis\Server. @binaryfire - Fixed stream writes under the
Swoole Runtime Hookincorrectly reporting partial writes as failures. @binaryfire - Fixed a commit addressing ownership issues with
proc_openstream descriptors. @binaryfire - Fixed
trailerbeing closed prematurely inHTTP/2streaming responses. @binaryfire - Fixed the
HTTP/2server not releasing the session after a fatal request, causing a crash when theworkershuts down. @binaryfire - Fixed
HTTP/2 sendfileloading the entire file at once by changing it to chunked streaming transmission. @binaryfire - Fixed incorrect interaction between
Content-Lengthand compression handling inHTTP/2responses. @matyhtf - Fixed the
HTTP/2 Bombsecurity vulnerability (remote denial-of-service attack). @matyhtf @catchem88 @adrian Liunardo @NathanFreeman - Fixed incomplete/corrupted data still being sent to the
task workerorpipetransport layer whenPHPserialization fails, while preserving the original exception and correctingfalsyreturn values being misjudged as no result. @binaryfire - Fixed
ssh2_exec()prematurely publishing the "completed" state whenstdout/stderrreachedEOF(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, andSwoole\Server, changing it to check native state only afterZendparameter parsing is complete, preventing object state corruption whenPHP 8scalar type conversion diagnostics trigger user code reentrancy. @binaryfire - Fixed resource leaks and duplicate listener replacement in
Swoole\ProcessPoolwhen setting up the listeningsocketfails. @matyhtf @binaryfire - Fixed
MessageBusinternal buffers incorrectly using an externalallocatorfor allocation, which could cause acoredumpon release. @matyhtf - Fixed an issue in
Swoole ZTSwhere, after settingPHP_STREAM_FLAG_NO_CLOSEto preventstdiofrom being closed prematurely,fds were not automatically closed at thread exit, causing file descriptor leaks. @matyhtf @binaryfire @NathanFreeman - Fixed
WebSocketframe parsing not rejecting control frames (CLOSE/PING/PONG) with theRSV1bit set. @matyhtf @binaryfire - Fixed target hostname length validation in
SOCKS5proxyDNStunnel mode. @matyhtf @binaryfire - Fixed a memory leak where, when
reactorinitialization failed, only an error code was returned without deleting the already allocatedreactorobject. @matyhtf @binaryfire - Fixed
Swoole Runtime hooknot correctly reporting timeout status on read/write timeouts (ETIMEDOUT) and instead marking the stream asEOF. @matyhtf @binaryfire - Fixed
Swoole\Thread::setPriority()not preserving the current scheduling policy when thepolicyparameter 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 emptybuffer. @binaryfire - Fixed
Swoole libraryreporting fatalacceptfailures of\Swoole\Coroutine\Serverthroughstart()anderrCode. @binaryfire - Fixed a memory leak in
Swoole library'sSwoole\RemoteObject\Clientthat had existed since6.2.0. Previously, each client would remain alive for the entire lifetime of the process, so every hookeddns_get_record(),checkdnsrr(),getmxrr(),mail(), andgethostbyaddr()call, as well as everySwoole\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()returnsnull; 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
ptyparameter fromboolto?string, representing the remote terminal type. @binaryfire - Fixed recoverability for incomplete shell sizes by issuing a warning and returning
falsewhen only width is provided without height, and removing the unreachable return after the fatal error. @binaryfire - Fixed the issue in
SWOOLE_THREADmode whereSwoole\Servercould not start when theset()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
deflateencoding. @lazerg - Fixed the issue where, when native hook was not enabled, destroying a native
CurlHandledid not hand the object release work back toext-curl, resulting in incorrect release logic. @matyhtf - Fixed cURL multi not correctly restoring the "readable and writable simultaneously" event mask in the
CURL_POLL_INOUTstate, 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_yieldis 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 aSwooleserver is closing a port, caused by passing aNULLport pointer. @alt-program - Fixed incorrect parameter validation, incorrect error messages, and crashes when passing objects for
SO_LINGER,SO_RCVTIMEO, andSO_SNDTIMEOinSwoole\Coroutine\Socket'ssetOption(). @binaryfire - Fixed an issue where calling
Swoole\Process::signal()inonManagerStartwhen built with--enable-thread-context(SW_USE_THREAD_CONTEXT) caused themanagerprocess to crash withSIGSEGV. @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 aSwooleprocess, mainly to make it aware ofCPUaffinity andcgrouplimits rather than simply reading the total number of onlineCPUs in the system. @matyhtf - The option arrays and option lookups in
Swoole library'sSwoole\Server\Helpernow useSwoole\Constant::OPTION_*constants instead of string literals. @deminy - Modernized the
Swoole librarycodebase to adapt toPHP 8.2+(constructor property promotion,readonlyproperties, first-class callable syntax,str_contains(), etc.), removing the remaining version compatibility code paths. Public constructor parameter names and non-finalclasses remain unchanged, so subclasses and named arguments still work correctly. @deminy
⚠ Notes
- The
stdextfeature has been removed from this version. Swoole v6.3.0-RC1can 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/WakeByAddressSingleAPI,配合 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 全体同仁恭祝各位:月圆人圆事事圆,花好灯好年年好。愿中秋快乐,阖家幸福!