- Add libmsg module: pymsg protocol implementation (4-byte BE length prefix + UTF-8) - Add AsyncQueue<T>: generic async batch queue with backpressure (aligned with Python AsyncRpcQueue) - Add MsgServer: select-based multi-client TCP server with optional thread pool - Add RpcClient/RpcServer: JSON RPC convention layer with automatic route injection - Refactor gateway/LogC.hpp to use AsyncQueue for async batch log delivery - Update gateway/DbC.hpp to add call_msg() using pymsg TCP protocol - Remove duplicated gateway/inc/Msg.hpp (now provided by libmsg) - Update gateway/Makefile and _inst.sh build order Fixes included: - pmsg_send size check uses kMaxMsgSize (64MiB) instead of 4GiB - MsgClient._running uses std::atomic<bool> for thread safety - Deadline-based recv timeout to prevent Slowloris (header+payload shared deadline)
42 lines
766 B
Bash
Executable File
42 lines
766 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
run_if_exists() {
|
|
local script="$1"
|
|
echo "---- run ${script} ----"
|
|
|
|
if [ -f "$script" ]; then
|
|
bash "$script"
|
|
fi
|
|
}
|
|
|
|
inst_module() {
|
|
local module="$1"
|
|
echo "======== Install ${module} ========"
|
|
|
|
local set_file="./${module}/_set.sh"
|
|
|
|
if [ -f "$set_file" ]; then
|
|
run_if_exists "$set_file"
|
|
return 0
|
|
else
|
|
echo "Failed" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
inst_module "libth"
|
|
inst_module "libhttp"
|
|
inst_module "libcrypt"
|
|
inst_module "libsqlite3"
|
|
inst_module "libmsg"
|
|
inst_module "gateway"
|
|
inst_module "waf" # waf 在 gateway 之前编译,部署时由 core 先拉起 waf 再拉起 gateway
|
|
inst_module "static"
|
|
inst_module "dnfs"
|
|
inst_module "db"
|
|
inst_module "smtp"
|
|
inst_module "captcha"
|
|
inst_module "confs"
|
|
inst_module "core" # core last
|