简体   繁体   English

c ++中的curl_easy_perform停止用于其他功能的计时器。

[英]curl_easy_perform in c++ stops a timer used for something else.

When i use curl_easy_perform in my c program it somehow stops a timer I have for checking something else. 当我在我的C程序中使用curl_easy_perform时,它以某种方式停止了我用于检查其他内容的计时器。

this is my code: 这是我的代码:

curl_easy_setopt(curl, CURLOPT_URL, query.c_str());
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headerlist);
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, changeddata.c_str());
result = curl_easy_perform(curl);

Without more info, I am going to guess that curl_easy_perform() is resulting in a signal, which messes up your timer. 如果没有更多信息,我将猜测curl_easy_perform()会导致产生信号,从而弄乱您的计时器。 Try adding this before calling curl_easy_perform(): 尝试在调用curl_easy_perform()之前添加以下内容:

curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);

This tells curl not to use any functions that install signal handlers or cause signals to be sent to your process. 这告诉curl不使用任何安装信号处理程序或导致信号发送到您的进程的函数。 See the curl_easy_setopt man page . 请参见curl_easy_setopt手册页

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM