【发布时间】:2022-01-05 04:45:51
【问题描述】:
下面两个代码的具体区别是什么?
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_DNS_SERVERS, "192.168.0.100");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
CURL *curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_DNS_LOCAL_IP4, "192.168.0.100");
ret = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
主要是与CURLOPT_DNS_SERVERS和CURLOPT_DNS_LOCAL_IP4相关的问题。
【问题讨论】: