- config.c/config.h: 极简 JSON 解析器,支持数字/字符串/布尔//注释 - cocoon_config_t 新增 gzip_enabled 字段(默认 true) - main.c: -c <file> 加载配置,--no-gzip 禁用压缩,命令行覆盖配置 - 修复 -r 参数 strdup 崩溃(避免 free 野指针) - 修复 signal handler 双重 free 问题 - 单元测试: test_config.c 17 个测试全部通过 - 集成测试: 32 项全部通过 - README 修正过时描述(配置方式、安全设计、-v 说明)
11 lines
205 B
JSON
11 lines
205 B
JSON
{
|
|
"root_dir": "./examples/www",
|
|
"port": 8080,
|
|
"threaded": true,
|
|
"num_workers": 4,
|
|
"max_connections": 10000,
|
|
"timeout_ms": 30000,
|
|
"log_level": "info",
|
|
"gzip_enabled": true
|
|
}
|