Skip to content

Commit 9a48e00

Browse files
committed
补上公开 anet_async_http_request 定义
头文件早已声明 anet_async_http_request(req), 但只实现了内部协程 anet_async_http_request_, 公开符号一直缺失 (链接期才暴露)。加一层 passthrough wrapper —— SDK 走异步请求路径时需要它。
1 parent 6f49c9c commit 9a48e00

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/http.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,12 @@ task_t* task_arg(anet_async_http_request_) {
696696
gen_end(NULL);
697697
}
698698

699+
// 公开入口: 内部协程 anet_async_http_request_ 直接把 req 当 arg 用 (借用,
700+
// 调用方须保证 req 及其指向的字符串在 task 跑完前存活)。
701+
task_t* anet_async_http_request(anet_async_http_request_t *req) {
702+
return anet_async_http_request_(req);
703+
}
704+
699705
/* ============================================================
700706
* 流式 (SSE) 客户端实现
701707
* ============================================================ */

0 commit comments

Comments
 (0)