From b04904cc7802c913cedfefc934df68ce9a42b72f Mon Sep 17 00:00:00 2001 From: xfy911 Date: Sun, 7 Jun 2026 00:06:04 +0800 Subject: [PATCH] =?UTF-8?q?docs(plan):=20=E6=9B=B4=E6=96=B0=E8=A7=84?= =?UTF-8?q?=E5=88=92=E6=96=87=E4=BB=B6=20=E2=80=94=20=E6=A0=87=E8=AE=B0=20?= =?UTF-8?q?HTTP/2=20POST=20=E6=94=AF=E6=8C=81=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cocoon-plan.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.cocoon-plan.md b/.cocoon-plan.md index 2edf7ac..8e17b1f 100644 --- a/.cocoon-plan.md +++ b/.cocoon-plan.md @@ -82,6 +82,16 @@ ## 最近行动记录 +- 2026-06-07: **本轮行动 — HTTP/2 POST 请求体支持** + - `on_data_chunk_recv_callback`: 实现请求体收集,将 DATA 帧数据追加到 `stream->request.body` + - `on_frame_recv_callback`: 根据请求方法选择处理方式(GET/HEAD → `http2_serve_static`,POST → `http2_serve_post`) + - `http2_serve_post`: 新增函数,处理 HTTP/2 POST 请求 + - 支持 multipart/form-data 文件上传(保存到 root_dir/uploads/) + - 支持 application/json 和 x-www-form-urlencoded 回显 + - 构建 JSON 响应并通过 nghttp2 发送 + - 包含 `multipart.h` 和 `platform.h` 到 `http2.c` + - 全部 142 个单元测试 + 77 项集成测试通过,编译零警告 + - 推送到 main - 2026-06-06: **本轮行动 — WebSocket 空闲超时 + 跨平台 poll/select 抽象** - `platform.h` / `platform.c`: 新增 `cocoon_socket_poll_readable()` 跨平台 socket 可读等待 - POSIX: `poll()` + `POLLIN`