🐛 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
WebSocketwhen compressing message frames, caused by certain server environments not supportingMAX_MEM_LEVEL=9 - Fixed data reception errors in
WebSocketwhen receiving consecutive compressed data frames, caused by the buffer not being cleared in time - Fixed the
data raceissue in thepdo_ocicoroutine client when processing non-PDO_PARAM_LOBdata
⭐️ Optimizations
- In
Http Server, when developers set theContent-Encodingheader,Swoolewill 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(), andPDO::sqliteCreateFunction()functions in the coroutine environment. Their implementation principle involves calling PHP functions as callbacks in thesqlite3engine, which is only feasible in single-threaded synchronous blocking mode. InSwoolecoroutine mode, theCfunctions ofsqlite3need to run in asynchronousAIOthreads. In theZTSversion, this can cause null pointer reads, while in theNTSversion, it may lead todata raceissues and occasional crashes. - Removed support for the
open_basedirsetting in thepdo_sqlitecoroutine client. It is unsafe to readPG(open_basedir)in a multithreaded environment. Ensure that thesqlite3database file path is a constant or other safe path. Do not use user input parameters as part of thesqlitedatabase 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协程模式下,需要将sqlite3的C函数置于异步的AIO线程中运行。在ZTS版本中会出现读取空指针,而在NTS下则会出现data race,引起偶发崩溃的问题 - 移除
pdo_sqlite协程客户端对open_basedir设置的支持,在多线程环境中无法安全读取PG(open_basedir),请务必保证sqlite3的数据库文件路径为常量或者其他安全的路径,不可使用用户输入的参数作为sqlite数据库文件路径的一部分