- 论坛徽章:
- 0
|
本帖最后由 river_dream 于 2011-08-05 17:34 编辑
各位大虾好,小菜遇到了一下问题,在此先谢谢了。
1、我使用Curl连接网站,希望可以异步获取信息,所以我想使用多线程,通过查找资料,在官方中有两种方式,一种是开启多线程,另一种是使用了类似于select机制的multi的方法,我还不清楚这两种方法的区别。
2、使Curl异步需要使用C-Ares来解决,但是,我不知道怎么样在编译的时候吧C-Ares编译到Curl中,我看了README.ares文件,并在http://blog.gmane.org/gmane.comp.web.curl.library/month=20100101网站中找到了一下代码:
- #include <curl/curl.h>
- int main()
- {
- curl_version_info_data*info=curl_version_info(CURLVERSION_NOW);
- if (info->features&CURL_VERSION_ASYNCHDNS) {
- printf( "ares enabled\n");
- } else {
- printf( "ares NOT enabled\n");
- }
- return 0;
- }
复制代码 通过这段代码的测试发现,我还是没有编译成功。
所以请大家给点建议和解决方法,小菜再次谢谢各位~~
下面是./configure --enable-ares
- curl version: 7.21.7
- Host setup: i686-pc-linux-gnu
- Install prefix: /usr/local
- Compiler: gcc
- SSL support: enabled (OpenSSL)
- SSH support: no (--with-libssh2)
- zlib support: enabled
- krb4 support: no (--with-krb4*)
- GSSAPI support: no (--with-gssapi)
- SPNEGO support: no (--with-spnego)
- TLS-SRP support: no (--enable-tls-srp)
- resolver: c-ares
- ipv6 support: enabled
- IDN support: enabled
- Build libcurl: Shared=yes, Static=yes
- Built-in manual: enabled
- Verbose errors: enabled (--disable-verbose)
- SSPI support: no (--enable-sspi)
- ca cert bundle: /etc/pki/tls/certs/ca-bundle.crt
- ca cert path: no
- LDAP support: enabled (OpenLDAP)
- LDAPS support: enabled
- RTSP support: enabled
- RTMP support: no (--with-librtmp)
- Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTSP SMTP SMTPS TELNET TFTP
复制代码 还需要什么详细信息我尽量提供,谢谢各位~~
我Make Curl 在最后提示了一些问题,如下:
- Making all in include
- make[1]: Entering directory `/home/curl-7.21.7/include'
- Making all in curl
- make[2]: Entering directory `/home/curl-7.21.7/include/curl'
- make all-am
- make[3]: Entering directory `/home/curl-7.21.7/include/curl'
- make[3]: Nothing to be done for `all-am'.
- make[3]: Leaving directory `/home/curl-7.21.7/include/curl'
- make[2]: Leaving directory `/home/curl-7.21.7/include/curl'
- make[2]: Entering directory `/home/curl-7.21.7/include'
- make[2]: Nothing to be done for `all-am'.
- make[2]: Leaving directory `/home/curl-7.21.7/include'
- make[1]: Leaving directory `/home/curl-7.21.7/include'
- make[1]: Entering directory `/home/curl-7.21.7'
- make[1]: Nothing to be done for `all-am'.
- make[1]: Leaving directory `/home/curl-7.21.7'
复制代码 提示为: Nothing to be done for `all-am'. |
|