Skip to content

Releases: swoole/swoole-src

v6.2.0

07 Apr 15:04

Choose a tag to compare

✨️ New Features

  • Added coroutine-based FTP client. By including the --enable-swoole-ftp option during compilation, coroutine support for FTP operations can be enabled, avoiding network blocking.
  • Added coroutine-based SSH client. By including the --with-swoole-ssh2 option during compilation, coroutine support for SSH operations can be enabled, improving concurrency efficiency.
  • Added support for io_uring in the HTTP coroutine server. The HTTP coroutine server can now utilize the high-performance io_uring event mechanism. Enable it by adding the --enable-uring_socket option during compilation for better I/O performance.
  • Added the Swoole\RemoteObject\Server module, providing transparent coroutine operation support for MongoDB.
  • Added the Swoole\Coroutine::setTimeLimit() function to control coroutine execution timeout, preventing coroutines from occupying resources for extended periods.
  • Added URL rewriting support for the HTTP static file server.
  • Added coroutine support for pdo_firebird.
  • Added support for PHP 8.5.
  • Added coroutine support for the gethostbyname function.
  • Optimized the implementation of Server::shutdown(), replacing signal communication with pipe communication in Process mode.
  • In the callback functions of Swoole's HTTP servers (including Swoole\Http\Server, Swoole\Http2\Server, and Swoole\Coroutine\Http\Server), the server property of the Swoole\Http\Request object now includes the server_addr field, which identifies the server's IP address.
  • Swoole\Coroutine::cancel now supports canceling all iouring operations.

SSH and FTP coroutine clients cannot coexist with PHP's ext-ssh and ext-ftp. To enable these features, you must disable PHP's ssh and ftp extensions.

🐛 Bug Fixes

  • Fixed an issue where HTTP2 server sessions were released multiple times in a multi-threaded environment.
  • Fixed an issue in version 8.5 where refresh_memory_manager() must be executed after forking a child process or creating a child thread; otherwise, the program would crash.
  • Fixed an issue where the swoole_get_local_mac function could not work properly on macOS systems.
  • Fixed a crash issue that could occur when manually suspending coroutines in a multi-threaded environment.
  • Fixed a compilation error on Alpine systems.
  • Fixed a memory leak issue when function hooking failed.
  • Fixed thread safety issues during the coroutine conversion process for pdo_sqlite and pdo_oci.
  • Fixed the sw_php_print_backtrace function to ensure its output format matches the backtrace information of PHP's built-in functions.
  • Fixed compilation failures caused by enabling --enable-uring-socket, --enable-trace-log, and --enable-error-log.
  • Fixed the issue where pdo_firebird could not be compiled due to undefined macros.

🛠️ Optimizations

  • Running php --ri swoole now outputs the version information of libpq.
  • Optimized the io_uring related logic in file coroutine operations.
  • Added PHP call stack information output when event addition fails.
  • Optimized the implementation code for swoole_get_local_ip and swoole_get_local_mac functions.
  • Optimized the coroutine waiting time for file locks, avoiding exponentially increasing sleep times that made locks increasingly difficult to acquire.
  • Improved compatibility with the Android platform.

📢 Notes

  • Removed the --enable-openssl compilation option; support for OpenSSL is now included by default.
  • --enable-uring-socket requires explicitly specifying either --enable-iouring or --with-liburing-dir.
  • No longer supports PHP 8.1.
  • The minimum required version of liburing is 2.8.

✨️ 新特性

  • 新增协程化FTP客户端,现通过编译时加入--enable-swoole-ftp选项,即可启用FTP操作的协程化支持,避免网络阻塞
  • 新增协程化SSH客户端,现通过编译时加入--with-swoole-ssh2选项,即可启用SSH操作的协程化支持,提升并发效率
  • 新增HTTP协程服务端支持io_uringHTTP协程服务端现可选用高性能的io_uring事件机制。在编译时加入--enable-uring_socket选项即可启用,以获得更优的 I/O 性能
  • 新增Swoole\RemoteObject\Server模块,为MongoDB提供透明化的协程操作支持
  • 新增Swoole\Coroutine::setTimeLimit()函数,用于控制协程执行超时时间,防止协程长时间占用资源
  • HTTP静态文件服务器添加URL重写支持
  • 新增对pdo_firebird的协程化支持
  • 支持PHP 8.5
  • 支持协程化 gethostbyname函数
  • 优化Server::shutdown()的实现,在Process模式下将信号通信替换为管道通信
  • 在 Swoole 的 HTTP 服务器(包括 Swoole\Http\Server、Swoole\Http2\Server 和 Swoole\Coroutine\Http\Server)的回调函数中,Swoole\Http\Request 对象的 server 属性新增了 server_addr 字段,该字段用于标识服务端的 IP 地址
  • Swoole\Coroutine::cancel 现支持取消所有iouring操作

SSHFTP协程客户端与PHPext-sshext-ftp无法共存,若要开启此项特性,需禁用PHPsshftp扩展

🐛 Bug修复

  • 修复 HTTP2 服务器会话(session)在多线程环境下发生多次释放的问题
  • 修复在8.5版本中,子进程fork或者子线程生成后需执行refresh_memory_manager(),否则将导致程序崩溃的问题
  • 修复macOS系统中swoole_get_local_mac函数无法正常工作的问题
  • 修复了在多线程环境下用户手动挂起协程时可能引发的崩溃问题
  • 修复在 Alpine 系统下的编译错误
  • 修复函数钩子(hook)调用失败时的内存泄漏问题
  • 修复pdo_sqlitepdo_oci协程化过程中的线程安全问题
  • 修复 sw_php_print_backtrace 函数,使其输出与 PHP 内置函数的回溯信息格式保持一致
  • 修复因启用 --enable-uring-socket、--enable-trace-log 和 --enable-error-log 导致的编译失败问题
  • 修复因为宏定义不存在的问题,导致pdo_firebird无法编译的问题

🛠️ 优化

  • 执行php --ri swoole会输出libpq的版本信息
  • 优化文件协程化操作中的io_uring相关逻辑
  • 在添加事件失败时输出 PHP 调用堆栈信息
  • 优化 swoole_get_local_ipswoole_get_local_mac 函数的实现代码
  • 优化文件锁的协程化等待时间,避免指数递增的睡眠时间导致锁越来越难获取
  • 提升了对Android平台的兼容性

📢 注意

  • 移除了--enable-openssl编译选项,现在默认包含对OpenSSL的支持
  • --enable-uring-socket需要明确指定--enable-iouring或者--with-liburing-dir其中一个
  • 不再支持PHP8.1
  • liburing要求的最低版本是2.8

v6.2.0-rc2

03 Mar 01:04
dd4cd56

Choose a tag to compare

v6.2.0-rc2 Pre-release
Pre-release

✨️ New Features

  • Added coroutine-based FTP client. By including the --enable-swoole-ftp option during compilation, coroutine support for FTP operations can be enabled, avoiding network blocking.
  • Added coroutine-based SSH client. By including the --enable-swoole-ssh option during compilation, coroutine support for SSH operations can be enabled, improving concurrency efficiency.
  • Added support for io_uring in the HTTP coroutine server. The HTTP coroutine server can now utilize the high-performance io_uring event mechanism. Enable it by adding the --enable-uring_socket option during compilation for better I/O performance.
  • Added the Swoole\RemoteObject\Server module, providing transparent coroutine operation support for MongoDB.
  • Added the Swoole\Coroutine::setTimeLimit() function to control coroutine execution timeout, preventing coroutines from occupying resources for extended periods.
  • Added URL rewriting support for the HTTP static file server.
  • Added coroutine support for pdo_firebird.
  • Added support for PHP 8.5.
  • Added coroutine support for the gethostbyname function.
  • Optimized the implementation of Server::shutdown(), replacing signal communication with pipe communication in Process mode.
  • In the callback functions of Swoole's HTTP servers (including Swoole\Http\Server, Swoole\Http2\Server, and Swoole\Coroutine\Http\Server), the server property of the Swoole\Http\Request object now includes the server_addr field, which identifies the server's IP address.
  • Swoole\Coroutine::cancel now supports canceling all iouring operations.

SSH and FTP coroutine clients cannot coexist with PHP's ext-ssh and ext-ftp. To enable these features, you must disable PHP's ssh and ftp extensions.

🐛 Bug Fixes

  • Fixed an issue where HTTP2 server sessions were released multiple times in a multi-threaded environment.
  • Fixed an issue in version 8.5 where refresh_memory_manager() must be executed after forking a child process or creating a child thread; otherwise, the program would crash.
  • Fixed an issue where the swoole_get_local_mac function could not work properly on macOS systems.
  • Fixed a crash issue that could occur when manually suspending coroutines in a multi-threaded environment.
  • Fixed a compilation error on Alpine systems.
  • Fixed a memory leak issue when function hooking failed.
  • Fixed thread safety issues during the coroutine conversion process for pdo_sqlite and pdo_oci.
  • Fixed the sw_php_print_backtrace function to ensure its output format matches the backtrace information of PHP's built-in functions.
  • Fixed compilation failures caused by enabling --enable-uring-socket, --enable-trace-log, and --enable-error-log.
  • Fixed the issue where pdo_firebird could not be compiled due to undefined macros.

🛠️ Optimizations

  • Running php --ri swoole now outputs the version information of libpq.
  • Optimized the io_uring related logic in file coroutine operations.
  • Added PHP call stack information output when event addition fails.
  • Optimized the implementation code for swoole_get_local_ip and swoole_get_local_mac functions.
  • Optimized the coroutine waiting time for file locks, avoiding exponentially increasing sleep times that made locks increasingly difficult to acquire.
  • Improved compatibility with the Android platform.

📢 Notes

  • Removed the --enable-openssl compilation option; support for OpenSSL is now included by default.
  • --enable-uring-socket requires explicitly specifying either --enable-iouring or --with-liburing-dir.
  • No longer supports PHP 8.1.
  • Swoole 6.2.0 RC2 is currently a release candidate version and can only be used in testing environments. It is prohibited to use it in production environments.

🎉 Chinese Lantern Festival greetings

Today is the Chinese Lantern Festival. All members of Swoole wish you: good health, all the best; may you keep improving, have a bright future, achieve your dreams, and enjoy smooth success in everything!

✨️ 新特性

  • 新增协程化FTP客户端,现通过编译时加入--enable-swoole-ftp选项,即可启用FTP操作的协程化支持,避免网络阻塞
  • 新增协程化SSH客户端,现通过编译时加入--enable-swoole-ssh选项,即可启用SSH操作的协程化支持,提升并发效率
  • 新增HTTP协程服务端支持io_uringHTTP协程服务端现可选用高性能的io_uring事件机制。在编译时加入--enable-uring_socket选项即可启用,以获得更优的 I/O 性能
  • 新增Swoole\RemoteObject\Server模块,为MongoDB提供透明化的协程操作支持
  • 新增Swoole\Coroutine::setTimeLimit()函数,用于控制协程执行超时时间,防止协程长时间占用资源
  • HTTP静态文件服务器添加URL重写支持
  • 新增对pdo_firebird的协程化支持
  • 支持PHP 8.5
  • 支持协程化 gethostbyname函数
  • 优化Server::shutdown()的实现,在Process模式下将信号通信替换为管道通信
  • 在 Swoole 的 HTTP 服务器(包括 Swoole\Http\Server、Swoole\Http2\Server 和 Swoole\Coroutine\Http\Server)的回调函数中,Swoole\Http\Request 对象的 server 属性新增了 server_addr 字段,该字段用于标识服务端的 IP 地址
  • Swoole\Coroutine::cancel 现支持取消所有iouring操作

SSHFTP协程客户端与PHPext-sshext-ftp无法共存,若要开启此项特性,需禁用PHPsshftp扩展

🐛 Bug修复

  • 修复 HTTP2 服务器会话(session)在多线程环境下发生多次释放的问题
  • 修复在8.5版本中,子进程fork或者子线程生成后需执行refresh_memory_manager(),否则将导致程序崩溃的问题
  • 修复macOS系统中swoole_get_local_mac函数无法正常工作的问题
  • 修复了在多线程环境下用户手动挂起协程时可能引发的崩溃问题
  • 修复在 Alpine 系统下的编译错误
  • 修复函数钩子(hook)调用失败时的内存泄漏问题
  • 修复pdo_sqlitepdo_oci协程化过程中的线程安全问题
  • 修复 sw_php_print_backtrace 函数,使其输出与 PHP 内置函数的回溯信息格式保持一致
  • 修复因启用 --enable-uring-socket、--enable-trace-log 和 --enable-error-log 导致的编译失败问题
  • 修复因为宏定义不存在的问题,导致pdo_firebird无法编译的问题

🛠️ 优化

  • 执行php --ri swoole会输出libpq的版本信息
  • 优化文件协程化操作中的io_uring相关逻辑
  • 在添加事件失败时输出 PHP 调用堆栈信息
  • 优化 swoole_get_local_ipswoole_get_local_mac 函数的实现代码
  • 优化文件锁的协程化等待时间,避免指数递增的睡眠时间导致锁越来越难获取
  • 提升了对Android平台的兼容性

📢 注意

  • 移除了--enable-openssl编译选项,现在默认包含对OpenSSL的支持
  • --enable-uring-socket需要明确指定--enable-iouring或者--with-liburing-dir其中一个
  • 不再支持PHP8.1
  • Swoole6.2.0RC2目前是测试版本,只能在测试环境使用,禁止在生产环境使用

🎉 元宵节祝贺

今天是中国元宵佳节,Swoole全体成员祝您:身体健康,万事如意;步步高升,前程似锦,心想事成,万事顺遂!

v6.1.7

25 Feb 14:18
4b7ddc2

Choose a tag to compare

🐛 Bug Fixed

  • Fixed an issue where improper configuration of the exponential backoff algorithm caused some coroutines to be unable to acquire locks for extended periods.
  • Added timeout control mechanism for the pdo_pgsql coroutine implementation to improve database operation stability.
  • Fixed an issue where Domain and Path parameters were specified when clearing a cookie but were not included in the actual response, preventing the cookie from expiring properly.

🐛 Bug 修复

  • 修复了因指数退避算法配置不当,导致部分协程长期无法获取锁的问题。
  • 为基于 pdo_pgsql 的协程实现增加了超时控制机制,以提升数据库操作的稳定性。
  • 修复了在清空 Cookie 时,虽然指定了 Domain 和 Path 参数,但实际响应中未携带这两个属性,导致 Cookie 无法正常过期的问题。

v6.2.0-rc1

16 Feb 16:02
323ecd6

Choose a tag to compare

v6.2.0-rc1 Pre-release
Pre-release

✨️ New Features

  • Added coroutine-based FTP client. By including the --enable-swoole-ftp option during compilation, coroutine support for FTP operations can be enabled, avoiding network blocking.
  • Added coroutine-based SSH client. By including the --enable-swoole-ssh option during compilation, coroutine support for SSH operations can be enabled, improving concurrency efficiency.
  • Added support for io_uring in the HTTP coroutine server. The HTTP coroutine server can now utilize the high-performance io_uring event mechanism. Enable it by adding the --enable-uring_socket option during compilation for better I/O performance.
  • Added the Swoole\RemoteObject\Server module, providing transparent coroutine operation support for MongoDB.
  • Added the Swoole\Coroutine::setTimeLimit() function to control coroutine execution timeout, preventing coroutines from occupying resources for extended periods.
  • Added URL rewriting support for the HTTP static file server.
  • Added coroutine support for pdo_firebird.
  • Added support for PHP 8.5.
  • Added coroutine support for the gethostbyname function.
  • Optimized the implementation of Server::shutdown(), replacing signal communication with pipe communication in Process mode.
  • In the callback functions of Swoole's HTTP servers (including Swoole\Http\Server, Swoole\Http2\Server, and Swoole\Coroutine\Http\Server), the server property of the Swoole\Http\Request object now includes the server_addr field, which identifies the server's IP address.

SSH and FTP coroutine clients cannot coexist with PHP's ext-ssh and ext-ftp. To enable these features, you must disable PHP's ssh and ftp extensions.

🐛 Bug Fixes

  • Fixed an issue where HTTP2 server sessions were released multiple times in a multi-threaded environment.
  • Fixed an issue in version 8.5 where refresh_memory_manager() must be executed after forking a child process or creating a child thread; otherwise, the program would crash.
  • Fixed an issue where the swoole_get_local_mac function could not work properly on macOS systems.
  • Fixed a crash issue that could occur when manually suspending coroutines in a multi-threaded environment.
  • Fixed a compilation error on Alpine systems.
  • Fixed a memory leak issue when function hooking failed.
  • Fixed thread safety issues during the coroutine conversion process for pdo_sqlite and pdo_oci.
  • Fixed the sw_php_print_backtrace function to ensure its output format matches the backtrace information of PHP's built-in functions.

🛠️ Optimizations

  • Running php --ri swoole now outputs the version information of libpq.
  • Optimized the io_uring related logic in file coroutine operations.
  • Added PHP call stack information output when event addition fails.
  • Optimized the implementation code for swoole_get_local_ip and swoole_get_local_mac functions.
  • Optimized the coroutine waiting time for file locks, avoiding exponentially increasing sleep times that made locks increasingly difficult to acquire.
  • Improved compatibility with the Android platform.

📢 Notes

  • Removed the --enable-openssl compilation option; support for OpenSSL is now included by default.
  • --enable-uring-socket requires explicitly specifying either --enable-iouring or --with-liburing-dir.
  • No longer supports PHP 8.1.
  • Swoole 6.2.0 RC1 is currently a release candidate version and can only be used in testing environments. It is prohibited to use it in production environments.

🧧 Chinese New Year greetings

Today is the first day of the Chinese New Year. At this moment of bidding farewell to the old and welcoming the new, the entire Swoole team extends our sincerest New Year blessings to you! We wish you good health, flourishing career, abundant wealth, and all your endeavors success in the new year! Thank you for your continued support and companionship. We look forward to joining hands with you to create an even more exciting future!

✨️ 新特性

  • 新增协程化FTP客户端,现通过编译时加入--enable-swoole-ftp选项,即可启用FTP操作的协程化支持,避免网络阻塞
  • 新增协程化SSH客户端,现通过编译时加入--enable-swoole-ssh选项,即可启用SSH操作的协程化支持,提升并发效率
  • 新增HTTP协程服务端支持io_uringHTTP协程服务端现可选用高性能的io_uring事件机制。在编译时加入--enable-uring_socket选项即可启用,以获得更优的 I/O 性能
  • 新增Swoole\RemoteObject\Server模块,为MongoDB提供透明化的协程操作支持
  • 新增Swoole\Coroutine::setTimeLimit()函数,用于控制协程执行超时时间,防止协程长时间占用资源
  • HTTP静态文件服务器添加URL重写支持
  • 新增对pdo_firebird的协程化支持
  • 支持PHP 8.5
  • 支持协程化 gethostbyname函数
  • 优化Server::shutdown()的实现,在Process模式下将信号通信替换为管道通信
  • 在 Swoole 的 HTTP 服务器(包括 Swoole\Http\Server、Swoole\Http2\Server 和 Swoole\Coroutine\Http\Server)的回调函数中,Swoole\Http\Request 对象的 server 属性新增了 server_addr 字段,该字段用于标识服务端的 IP 地址

SSHFTP协程客户端与PHPext-sshext-ftp无法共存,若要开启此项特性,需禁用PHPsshftp扩展

🐛 Bug修复

  • 修复 HTTP2 服务器会话(session)在多线程环境下发生多次释放的问题
  • 修复在8.5版本中,子进程fork或者子线程生成后需执行refresh_memory_manager(),否则将导致程序崩溃的问题
  • 修复macOS系统中swoole_get_local_mac函数无法正常工作的问题
  • 修复了在多线程环境下用户手动挂起协程时可能引发的崩溃问题
  • 修复在 Alpine 系统下的编译错误
  • 修复函数钩子(hook)调用失败时的内存泄漏问题
  • 修复pdo_sqlitepdo_oci协程化过程中的线程安全问题
  • 修复 sw_php_print_backtrace 函数,使其输出与 PHP 内置函数的回溯信息格式保持一致

🛠️ 优化

  • 执行php --ri swoole会输出libpq的版本信息
  • 优化文件协程化操作中的io_uring相关逻辑
  • 在添加事件失败时输出 PHP 调用堆栈信息
  • 优化 swoole_get_local_ipswoole_get_local_mac 函数的实现代码
  • 优化文件锁的协程化等待时间,避免指数递增的睡眠时间导致锁越来越难获取
  • 提升了对Android平台的兼容性

📢 注意

  • 移除了--enable-openssl编译选项,现在默认包含对OpenSSL的支持
  • --enable-uring-socket需要明确指定--enable-iouring或者--with-liburing-dir其中一个
  • 不再支持PHP8.1
  • Swoole6.2.0RC1目前是测试版本,只能在测试环境使用,禁止在生产环境使用

🧧 新春祝贺

今天是中国农历新年大年初一,在这辞旧迎新的美好时刻,Swoole团队全体成员向您致以最诚挚的新春祝福!愿新的一年里,您身体健康,事业蒸蒸日上,财源滚滚而来,万事顺遂,心想事成!感谢您一直以来的支持与陪伴,期待与您携手共创更加精彩的未来!

v6.1.6

28 Dec 12:23
d611ff3

Choose a tag to compare

🐛 Bug Fixed

  • Fix the issue where the finish attribute remains false when receiving continuous frames in websocket.
  • Fix compilation warnings generated when using the --enable-swoole-sqlite compilation option.
  • Automatically remove HOOK_SOCKETS from the runtime hook flags when the ext-sockets extension is detected as not enabled.

🐛 Bug修复

  • 修复websocket接收连续帧时finish属性始终为false的问题。
  • 修复使用--enable-swoole-sqlite编译选项时产生的编译警告。
  • 当检测到未启用 ext-sockets 扩展时,自动从运行时钩子标志中移除 HOOK_SOCKETS。

v6.1.5

21 Dec 09:32
a3a1350

Choose a tag to compare

🐛 Bug Fixes

  • Fixed a crash issue when users manually suspend coroutines in a multithreaded environment
  • Fixed the issue where the System::socket_poll() function incorrectly closed sockets after failing to add events
  • Fixed decompression failure in WebSocket when compressing message frames, caused by certain server environments not supporting MAX_MEM_LEVEL=9
  • Fixed data reception errors in WebSocket when receiving consecutive compressed data frames, caused by the buffer not being cleared in time
  • Fixed the data race issue in the pdo_oci coroutine client when processing non-PDO_PARAM_LOB data

⭐️ Optimizations

  • In Http Server, when developers set the Content-Encoding header, Swoole will no longer automatically compress the response body. Instead, developers need to implement compression logic themselves and output the corresponding content.

🗑 Removals

  • Removed the PDO::sqliteCreateAggregate(), PDO::sqliteCreateCollation(), and PDO::sqliteCreateFunction() functions in the coroutine environment. Their implementation principle involves calling PHP functions as callbacks in the sqlite3 engine, which is only feasible in single-threaded synchronous blocking mode. In Swoole coroutine mode, the C functions of sqlite3 need to run in asynchronous AIO threads. In the ZTS version, this can cause null pointer reads, while in the NTS version, it may lead to data race issues and occasional crashes.
  • Removed support for the open_basedir setting in the pdo_sqlite coroutine client. It is unsafe to read PG(open_basedir) in a multithreaded environment. Ensure that the sqlite3 database file path is a constant or other safe path. Do not use user input parameters as part of the sqlite database file path.

🐛 Bug修复

  • 修复多线程环境下用户手动挂起协程的崩溃问题
  • 修复System::socket_poll()函数添加事件失败后,错误关闭套接字的问题
  • 修复WebSocket 压缩消息帧时部分服务器环境不支持MAX_MEM_LEVEL=9导致解压失败的问题
  • 修复WebSocket接收解压格式连续数据帧时,因缓冲区未及时清空而导致后续数据接收错误的问题
  • 修复pdo_oci协程客户端处理非PDO_PARAM_LOB数据时的data race问题

⭐️ 优化

  • Http Server中,当开发者设置了Content-Encoding头部时,Swoole将不再对响应体进行自动压缩,而需要由开发者自行实现压缩逻辑并输出相应内容。

🗑 移除

  • 移除协程环境下PDO::sqliteCreateAggregate()PDO::sqliteCreateCollation()PDO::sqliteCreateFunction()函数,其实现原理是将PHP函数作为回调在sqlite3引擎中调用,这些特性仅在单线程同步阻塞模式中可用,而Swoole协程模式下,需要将sqlite3C函数置于异步的AIO线程中运行。在ZTS版本中会出现读取空指针,而在NTS下则会出现data race,引起偶发崩溃的问题
  • 移除pdo_sqlite协程客户端对open_basedir设置的支持,在多线程环境中无法安全读取PG(open_basedir),请务必保证sqlite3的数据库文件路径为常量或者其他安全的路径,不可使用用户输入的参数作为sqlite数据库文件路径的一部分

v6.1.4

06 Dec 06:33
8155fcd

Choose a tag to compare

🐛 Bug Fixes

  • Fix the memory leak issue in the curl module.

🐛 Bug 修复

  • 修复curl模块内存泄漏的问题。

v6.1.3

26 Nov 01:48
54792f6

Choose a tag to compare

Release Notes

🐛 Bug Fixes

HTTP/2 Server

  • Fixed Safari Compatibility Issue: Resolved a flow control compatibility issue when the HTTP/2 server sends large files to Safari browsers.
  • Fixed Data Race in Cached Date Response Header: Fixed a data race condition in the cached Date response header for the HTTP/2 server in multi-threaded mode.
  • Fixed package_max_length Configuration Not Taking Effect:
    • The server now returns a 413 Payload Too Large error if the Content-Length in the received HEADERS frame exceeds the configured value.
    • The server sends an HTTP/2 RST_STREAM frame to terminate the stream if the total length of consecutively received DATA frames exceeds the configured value.
  • Fixed Memory Out-of-Bounds in Multi-threaded Coroutine Mode: Resolved a memory out-of-bounds issue when enabling enable_reuse_port in the multi-threaded coroutine version of the HTTP/2 server.
  • Fixed TLS Variable Destruction Issue: Fixed a double free issue occurring during the destruction of TLS (Thread Local Storage) variables upon thread exit in the multi-threaded HTTP/2 server.

Redis Server

  • Fixed packet assembly anomalies in Redis\Server::format() when processing large strings.

WebSocket Server

  • Fixed Control Frame Data Contamination: Resolved an issue where automatically replied ping/pong/close control frames from the WebSocket server carried residual data from previous text or binary frames due to uncleared buffers.

Multi-threading Related

  • Fixed Data Race in swoole_get_task_tmpdir(): Resolved a data race condition when calling this function in a multi-threaded environment.
  • Fixed Memory Out-of-Bounds Access in Runtime Hooks: Fixed memory out-of-bounds access triggered when setting runtime hooks in a multi-threaded environment.
    • ⚠️ Important Change: Runtime hooks can now only be set in the main thread and must be configured before creating any child threads.

Platform Compatibility

  • Fixed FreeBSD Compilation Failure: Resolved compilation failures on FreeBSD systems.

✨ Enhancements

  • Added Android Platform Support: Improved compatibility with the Android platform; now supported in Termux environments.
  • Synchronized Updates from PHP 8.x curl Module: Adapted relevant updates from the curl extension in PHP versions 8.1, 8.2, and 8.3.

Note: This update includes several critical fixes for multi-threaded mode. Users utilizing multi-threaded mode are strongly advised to upgrade as soon as possible.

更新记录

🐛 Bug 修复

HTTP/2 服务器

  • 修复 Safari 浏览器兼容性问题:解决 HTTP/2 服务器在向 Safari 浏览器发送大文件时的流量控制兼容性问题
  • 修复 Date 响应头缓存的数据竞争:解决多线程模式下 HTTP/2 服务器的 Date 响应头缓存存在的数据竞争问题
  • 修复 package_max_length 配置未生效
    • 当接收的 Header 帧中 Content-Length 超过配置值时,服务器将返回 413 Payload Too Large 错误
    • 当连续接收的 Data 帧总长度超过配置值时,服务器将发送 HTTP/2 RST_STREAM 帧终止流
  • 修复多线程协程模式下的内存越界:解决多线程模式协程版 HTTP/2 服务器开启 enable_reuse_port 时发生的内存越界问题
  • 修复 TLS 变量销毁问题:解决多线程模式 HTTP/2 服务器在线程退出时 TLS (Thread Local Storage) 变量销毁时发生的 double free 问题

Redis 服务器

  • 修复 Redis\Server::format() 处理大字符串出现的组包异常问题

WebSocket 服务器

  • 修复控制帧数据污染问题:解决 WebSocket 服务端自动回复的 ping/pong/close 控制帧因未清空缓存,导致携带前一个文本帧或二进制帧残留数据的问题

多线程相关

  • 修复 swoole_get_task_tmpdir() 数据竞争:解决多线程环境下调用该函数时存在的数据竞争问题
  • 修复运行时钩子的内存越界访问:解决多线程环境下设置运行时钩子时触发的内存越界访问问题
    • ⚠️ 重要变更:运行时钩子现在仅允许在主线程中设置,且必须在创建任何子线程之前完成设置

平台兼容性

  • 修复 FreeBSD 编译失败:解决在 FreeBSD 系统下的编译失败问题

✨ 功能增强

  • 新增 Android 平台支持:提升在 Android 平台的兼容性,现已支持在 Termux 环境下运行
  • 同步 PHP 8.x curl 模块更新:适配 PHP 8.1、8.2 及 8.3 版本中 curl 扩展的相关更新

注意事项:本次更新包含多项多线程模式下的关键修复,建议使用多线程模式的用户尽快升级。

v6.1.2

11 Nov 14:58
fd143a8

Choose a tag to compare

  • No longer throw warnings when failing to set the socket receive/send buffer size
  • Fixed an issue in Swoole\Http\Server where the onClose callback might execute before onRequest when handling HTTP2 requests, leading to a use-after-free problem
  • Optimized the getSocket() method by duplicating the file descriptor when exporting the php sockets resource object, preventing php sockets from affecting the socket held by Swoole upon closure
  • Fixed a memory leak issue in Swoole\Async\Client
  • Fixed an issue where Swoole\Coroutine\Http\Client of IPv6 type could not use Socks5 proxy
  • Synchronized updates to adapt to relevant changes in the CURL extension in PHP 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.4CURL 扩展的相关更新
  • 新增 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后,对部分文件操作进行异步读写调用的场景。

v6.1.1

30 Oct 14:35
9c0578b

Choose a tag to compare

  • Fixed a compilation failure caused by missing zlib dependency.
  • Optimized the resource management logic in the curl module to prevent use-after-free risks.
  • Resolved the absence of fdatasync on macOS systems.
  • Improved the log output format for coroutine deadlock detection.

简体中文

  • 修复因为缺少zlib依赖导致编译失败的问题。
  • 优化curl模块的资源管理逻辑,以规避释放后再次使用的风险。
  • 修复macos系统没有fdatasync的问题。
  • 优化协程死锁检测日志输出格式。