--- parser3/src/classes/curl.C 2013/04/21 21:24:53 1.26 +++ parser3/src/classes/curl.C 2013/07/22 20:06:50 1.29 @@ -16,7 +16,7 @@ #include "pa_http.h" #include "ltdl.h" -volatile const char * IDENT_CURL_C="$Id: curl.C,v 1.26 2013/04/21 21:24:53 moko Exp $"; +volatile const char * IDENT_CURL_C="$Id: curl.C,v 1.29 2013/07/22 20:06:50 moko Exp $"; class MCurl: public Methoded { public: @@ -44,8 +44,7 @@ typedef void (*t_curl_formfree)(struct c #define DLINK(name) GLINK(name) if(!f_##name) return "function " #name " was not found"; static const char *dlink(const char *dlopen_file_spec) { - if(lt_dlinit()) - return lt_dlerror(); + pa_dlinit(); lt_dlhandle handle=lt_dlopen(dlopen_file_spec); @@ -112,6 +111,7 @@ public: fcurl = f_curl_easy_init(); foptions = new ParserOptions(); f_curl_easy_setopt(fcurl, CURLOPT_POSTFIELDSIZE, 0); // fix libcurl bug + f_curl_easy_setopt(fcurl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); // avoid ipv6 by default } ~Temp_curl() { f_curl_easy_cleanup(fcurl); @@ -122,11 +122,7 @@ public: }; bool curl_linked = false; -#ifdef WIN32 -const char *curl_library="libcurl.dll"; -#else -const char *curl_library="libcurl.so"; -#endif +const char *curl_library="libcurl" LT_MODULE_EXT; const char *curl_status = 0; @@ -230,6 +226,7 @@ public: CURL_OPT(CURL_INT, FOLLOWLOCATION); CURL_OPT(CURL_INT, UNRESTRICTED_AUTH); + CURL_OPT(CURL_INT, IPRESOLVE); CURL_OPT(CURL_INT, POST); CURL_OPT(CURL_INT, HTTPGET);