github swoole/swoole-src v6.1.3

2 hours ago

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 扩展的相关更新

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

Don't miss a new swoole-src release

NewReleases is sending notifications on new releases.