C++CURL庫的一個bug,CURLOPT_TIMEOUT_MS設置時間小於1s直接報錯

解決辦法:
This is a bug of CURL.

If your timeout setting is less than 1s, it will directly return an error.

Solution is:

curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1);
conn is the pointer of CURL, e.g.:

CURL *conn = NULL;
curl_easy_setopt(conn, CURLOPT_NOSIGNAL, 1);

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章