如何使用libcurl函数“curl_easy_setopt(CURL * handle,CURLOPT_DNS_LOCAL_IP4,char * address);” [英] How can I use libcurl function "curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP4, char *address);"

查看:865
本文介绍了如何使用libcurl函数“curl_easy_setopt(CURL * handle,CURLOPT_DNS_LOCAL_IP4,char * address);”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用函数 curl_easy_setopt(CURL * handle,CURLOPT_DNS_LOCAL_IP4,char * address),但是当我下载源代码时,

I want to use function curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP4, char *address), but when I download the source code,

./configure && make && make install

每个fucntion都可以,但是这个函数 curl_easy_setopt(CURL * CURLOPT_DNS_LOCAL_IP4,char * address)。此功能说明 http://curl.haxx.se/libcurl/c/CURLOPT_DNS_LOCAL_IP4。 html.AVAILABILITY 表示此选项要求libcurl是使用支持此操作的解析器后端构建的。 c-ares后端是唯一的。这是什么意思?我如何构建libcurl与resoluver后端。

every fucntion is OK but this function curl_easy_setopt(CURL *handle, CURLOPT_DNS_LOCAL_IP4, char *address). This function explanation http://curl.haxx.se/libcurl/c/CURLOPT_DNS_LOCAL_IP4.html.AVAILABILITY says this option requires that libcurl was built with a resolver backend that supports this operation. The c-ares backend is the only such one. what does it mean? how I build libcurl with a resoluver backend.

谢谢

推荐答案

您可以构建您的libcurl以使用 c-ares 进行名称解析。这是因为正常名称解析器功能无法告诉使用哪些服务器(在进行通信时不使用哪个源地址),它们使用您在系统文件中设置的那些。

It means that you need to make sure that you build your libcurl to use c-ares for name resolving. This is because "normal" name resolver functions can't be told which servers to use (nor which source address to use when doing that communication), they use the ones you set in the system files.

c-ares是一个单独的库,它执行异步DNS和名称解析器调用,libcurl可以被告知使用。

c-ares is a separate library that does asynchronous DNS and name resolver calls that libcurl can be told to use.

这篇关于如何使用libcurl函数“curl_easy_setopt(CURL * handle,CURLOPT_DNS_LOCAL_IP4,char * address);”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆