Download Latest Version rtty-9.1.0.tar.gz (3.0 MB)
Email in envelope

Get an email when there's a new version of rtty

Home / v9.0.4
Name Modified Size InfoDownloads / Week
Parent folder
rtty-9.0.4.tar.gz 2025-12-04 3.0 MB
README.md 2025-12-04 3.3 kB
v9.0.4 source code.tar.gz 2025-12-04 2.9 MB
v9.0.4 source code.zip 2025-12-04 3.0 MB
Totals: 4 Items   8.9 MB 0

Overview

This release addresses a critical stability issue in the HTTP proxy functionality and improves build system compatibility.

Changes

Bug Fixes

Fixed use-after-free in HTTP connection handling

Issue: A race condition could occur during the HTTP connection establishment phase. If a connection object was freed while an asynchronous connection attempt was in progress, the callback on_connected might access invalid memory, leading to a crash (segmentation fault) or assertion failure in the event loop.

Solution:

  • Introduced a connection state flag (HTTP_CON_FLAG_CONNECTING) to track pending connections.
  • Implemented a deferred deletion mechanism. If a connection is freed while connecting, the actual cleanup is postponed until the connection attempt completes (success or failure), ensuring the event loop watchers are safely stopped.

Improvements

Refactored HTTP connection flags

Change: Replaced the boolean https field in the http_connection structure with a bitmask flags. Benefit: This change improves code extensibility, allowing for more connection states (like the new connecting state) to be managed efficiently within a single field without increasing memory usage.

Build System

Fix compilation with newer CMake

Change: Updated the minimum required CMake version in CMakeLists.txt. Reason: Newer versions of CMake have deprecated or removed support for very old CMake versions (< 3.5). This ensures the project builds correctly in modern development environments.

Full Changelog: https://github.com/zhaojh329/rtty/compare/v9.0.3...v9.0.4


概述

本次发布修复了 HTTP 代理功能中的一个严重稳定性问题,并改进了构建系统的兼容性。

变更内容

错误修复

修复 HTTP 连接处理中的 Use-After-Free 问题

问题描述: 在 HTTP 连接建立阶段可能发生竞态条件。如果在异步连接尝试进行时释放了连接对象,on_connected 回调函数可能会访问无效内存,导致程序崩溃(段错误)或触发事件循环的断言失败。

解决方案:

  • 引入了连接状态标志 (HTTP_CON_FLAG_CONNECTING) 来追踪挂起的连接。
  • 实现了延迟删除机制。如果连接在建立过程中被释放,实际的清理工作会推迟到连接尝试完成(成功或失败)后进行,从而确保能够安全地停止事件循环观察者。

改进

重构 HTTP 连接标志

变更:http_connection 结构体中的 https 布尔字段替换为位掩码 flags收益: 此更改提高了代码的可扩展性,允许在不增加内存使用的情况下,在一个字段内高效地管理更多的连接状态(如新增的连接中状态)。

构建系统

修复在较新 CMake 版本下的编译问题

变更: 更新了 CMakeLists.txt 中所需的最低 CMake 版本。 原因: 较新版本的 CMake 已经弃用或移除了对非常旧的 CMake 版本(< 3.5)的支持。此更新确保项目能在现代开发环境中正确构建。

完整变更记录: https://github.com/zhaojh329/rtty/compare/v9.0.3...v9.0.4

Source: README.md, updated 2025-12-04