【发布时间】:2015-03-25 09:28:01
【问题描述】:
我正在尝试创建一个 NaCl 模块,该模块将执行 curl 操作。我成功集成了 naclports curl 库,编写了一个非常简单的模块并将其托管在本地服务器上,但无法让 curl 正常工作。当我访问模块时(在 Chrome 41 上),我总是收到以下错误序列:
Rebuilt URL to: http://www.google.com/
localhost/:1 * timeout on name lookup is not supported
localhost/:1 * Hostname was NOT found in DNS cache
localhost/:1 * Curl_ipv4_resolve_r failed for www.google.com
localhost/:1 * Couldn't resolve host 'www.google.com'
localhost/:1 * Closing connection 0
main.cpp
#include <ppapi_simple/ps_main.h>
#include <iostream>
#include <unistd.h>
#include "include/curl/curl.h"
int ppapi_simple_main(int argc,char* argv[]){
CURL* curl;
CURLcode res;
curl=curl_easy_init();
if(curl){
curl_easy_setopt(curl,CURLOPT_URL,"http://www.google.com");
curl_easy_setopt(curl,CURLOPT_VERBOSE,1L);
res=curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
return 0;
}
PPAPI_SIMPLE_REGISTER_MAIN(ppapi_simple_main)
【问题讨论】:
标签: curl libcurl google-nativeclient