【发布时间】:2015-03-26 06:38:58
【问题描述】:
是否通过 CURLOPT_WRITEFUNCTION 指定给 cURL 的函数是从调用 curl_easy_perform() 的同一线程调用的?
void read_http()
{
curl_easy_setopt(CURLOPT_WRITEFUNCTION, on_write_data);
curl_easy_perform(hcurl);
}
回调是这样的
void on_write_data(buff, ...)
{
copy_to(buff, shared_buff);
}
客户端代码看起来像
read_http();
// use shared_buff
问题是当read_http() 返回时是否已读取所有http 数据?或者它是否仍在进行中?
【问题讨论】: