修复: 升级框架并完善报告导出
- 升级 Drogon 和 Trantor,修复畸形请求导致的连接计数泄漏\n- 增加第三方框架版本校验与自动重建\n- 完善完整报告导出和接口文档
This commit is contained in:
Vendored
+39
-4
@@ -34,9 +34,36 @@ export DROGON_INSTALL="${THIRD_PARTY}/drogon/install/${TARGET_ARCH}"
|
||||
# 由顶层 CMakeLists.txt 通过 CMAKE_PREFIX_PATH 注入查找路径。
|
||||
DROGON_REPO="${THIRD_PARTY}/drogon_repo"
|
||||
DROGON_CONFIG="${DROGON_INSTALL}/libs/cmake/Drogon/DrogonConfig.cmake"
|
||||
EXPECTED_DROGON_VERSION="1.9.13"
|
||||
EXPECTED_TRANTOR_VERSION="1.5.28"
|
||||
|
||||
if [ -f "${DROGON_CONFIG}" ]; then
|
||||
echo "[third_party] Drogon 已编译,跳过 (${DROGON_INSTALL})"
|
||||
framework_versions_match() {
|
||||
local drogon_header="${DROGON_INSTALL}/include/drogon/version.h"
|
||||
local drogon_cmake="${DROGON_INSTALL}/libs/cmake/Drogon/DrogonConfigVersion.cmake"
|
||||
local trantor_cmake="${DROGON_INSTALL}/libs/cmake/Trantor/TrantorConfigVersion.cmake"
|
||||
local drogon_link trantor_link
|
||||
|
||||
[ -f "${drogon_header}" ] &&
|
||||
[ -f "${drogon_cmake}" ] &&
|
||||
[ -f "${trantor_cmake}" ] &&
|
||||
grep -Fq "#define DROGON_VERSION \"${EXPECTED_DROGON_VERSION}\"" "${drogon_header}" &&
|
||||
grep -Fq "set(PACKAGE_VERSION \"${EXPECTED_DROGON_VERSION}\")" "${drogon_cmake}" &&
|
||||
grep -Fq "set(PACKAGE_VERSION \"${EXPECTED_TRANTOR_VERSION}\")" "${trantor_cmake}" || return 1
|
||||
|
||||
drogon_link="$(readlink "${DROGON_INSTALL}/libs/libdrogon.so.1" 2>/dev/null || true)"
|
||||
trantor_link="$(readlink "${DROGON_INSTALL}/libs/libtrantor.so.1" 2>/dev/null || true)"
|
||||
[ "${drogon_link}" = "libdrogon.so.${EXPECTED_DROGON_VERSION}" ] &&
|
||||
[ "${trantor_link}" = "libtrantor.so.${EXPECTED_TRANTOR_VERSION}" ]
|
||||
}
|
||||
|
||||
if ! grep -Fq "set(DROGON_PATCH_VERSION 13)" "${DROGON_REPO}/CMakeLists.txt" ||
|
||||
! grep -Fq "set(TRANTOR_PATCH_VERSION 28)" "${DROGON_REPO}/trantor/CMakeLists.txt"; then
|
||||
echo "[third_party] 错误:Drogon 源码不是 ${EXPECTED_DROGON_VERSION} / Trantor ${EXPECTED_TRANTOR_VERSION}" >&2
|
||||
return 1 2>/dev/null || exit 1
|
||||
fi
|
||||
|
||||
if framework_versions_match; then
|
||||
echo "[third_party] Drogon ${EXPECTED_DROGON_VERSION} / Trantor ${EXPECTED_TRANTOR_VERSION} 已编译,跳过 (${DROGON_INSTALL})"
|
||||
else
|
||||
if [ ! -f "${DROGON_REPO}/CMakeLists.txt" ]; then
|
||||
echo "[third_party] ⚠️ 源码目录不存在: drogon_repo,跳过 Drogon"
|
||||
@@ -47,7 +74,11 @@ else
|
||||
echo "[third_party] (后续 cmake find_package(Drogon) 将报错)"
|
||||
return 0 2>/dev/null || exit 0
|
||||
else
|
||||
echo "[third_party] 编译 Drogon + Trantor (产物缺失) → ${DROGON_INSTALL}"
|
||||
if [ -e "${DROGON_INSTALL}" ]; then
|
||||
echo "[third_party] 框架产物版本不匹配,重建 ${DROGON_INSTALL}"
|
||||
rm -rf "${DROGON_INSTALL}"
|
||||
fi
|
||||
echo "[third_party] 编译 Drogon ${EXPECTED_DROGON_VERSION} + Trantor ${EXPECTED_TRANTOR_VERSION} → ${DROGON_INSTALL}"
|
||||
|
||||
DROGON_BUILD="${DROGON_REPO}/build"
|
||||
rm -rf "${DROGON_BUILD}"
|
||||
@@ -70,7 +101,11 @@ else
|
||||
cmake --install "${DROGON_BUILD}"
|
||||
rm -rf "${DROGON_BUILD}"
|
||||
|
||||
echo "[third_party] ✅ Drogon + Trantor → ${DROGON_INSTALL}"
|
||||
if ! framework_versions_match; then
|
||||
echo "[third_party] 错误:框架安装版本校验失败" >&2
|
||||
return 1 2>/dev/null || exit 1
|
||||
fi
|
||||
echo "[third_party] ✅ Drogon ${EXPECTED_DROGON_VERSION} / Trantor ${EXPECTED_TRANTOR_VERSION} → ${DROGON_INSTALL}"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user