libcurl - 问题当 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;
}
解决方案
推荐阅读
- flutter - Flutter mixin 与抽象类
- apache - Jenkins 背后的 Apache 代理
- javascript - 如何在Angular中将24小时格式计算为分钟请任何人发送打字稿代码
- php - 将日期值从带有错误顺序的破折号的 html 表单转换为正确顺序的斜线
- python - 我想使用 python 替换 Excel 单元格值
- react-native - React Native TextInput 失去了对来自 useState 的调用钩子的关注
- java - Java中两个字节数组的绝对值减法
- php - 如何将css规则添加到jquery中动态创建的元素
- javascript - 给定一个级别,如何返回树的所有子级?
- ruby-on-rails - 使用带有错误的 Rails 设置的 Docker