首页 > 解决方案 > 问题当 curl_easy_perform 在线程返回代码 7 中运行时

问题描述

当 curl_easy_perform 在线程返回代码 7 但不在主线程中运行时。内核 2.36.2 uClibc-0.9.33 libpthread.so-0.9.33.2

curl_east_perform 在以下代码中运行良好:

int main(void)  {
CURL * curl = curl_easy_inint;
curl_easy_setopt();
curl_east_perform(curl);
curl_easy_cleanup;
return 0;
}

curl_east_perform 将始终在以下代码中返回 7:

int main(void) {
curl_global_init(CURL_GLOBAL_ALL);
pthread_create(pid, NULL, curl_run_process, NULL);
return 0;
}
void *curl_run_process(void *arg) {
CURL *curl = curl_easy_init;
curl_easy_setopt();
curl_east_perform(curl);
curl_easy_cleanup;

} 

标签: libcurl

解决方案


推荐阅读