--- parser3/src/classes/curl.C 2013/03/14 02:42:57 1.24 +++ 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.24 2013/03/14 02:42:57 misha 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; @@ -224,9 +220,13 @@ public: CURL_OPT(CURL_URLENCODE, USERAGENT); CURL_OPT(CURL_URLENCODE, REFERER); CURL_OPT(CURL_INT, AUTOREFERER); + CURL_OPT(CURL_STRING, ENCODING); // gzip or deflate + CURL_OPT(CURL_STRING, ACCEPT_ENCODING); // gzip or deflate + 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);