diff --git a/appveyor.yml b/appveyor.yml index 3de24b5..1327f6b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,32 +6,38 @@ os: shallow_clone: true environment: - LUAROCKS_VER: 2.2.1 - CURL_VER: 7.50.1 + LR_EXTERNAL: c:\external + CURL_VER: 7.51.0 matrix: - - LUA_VER: 5.1.5 - - LUA_VER: 5.2.4 - - LUA_VER: 5.3.0 - # - LJ_VER: 2.0.3 - # - LJ_VER: 2.1 + - LUA: "lua 5.1" + - LUA: "lua 5.2" + - LUA: "lua 5.3" platform: - x64 - x86 + # - mingw cache: - - c:\lua -> appveyor.yml - - c:\external -> appveyor.yml - - C:\Program Files (x86)\LuaRocks -> appveyor.yml - - C:\Program Files\LuaRocks -> appveyor.yml - -init: - - call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %platform% + - c:\hererocks -> appveyor.yml install: - # Setup Lua development/build environment - - call .appveyor\install.bat + - set PATH=C:\Python27\Scripts;%LR_EXTERNAL%;%PATH% + - if /I "%platform%"=="x86" set HR_TARGET=vs_32 + - if /I "%platform%"=="x64" set HR_TARGET=vs_64 + - if /I "%platform%"=="mingw" set HR_TARGET=mingw + - if /I "%platform%"=="mingw" set PATH=C:\MinGW\bin;%PATH% + - if not exist "%LR_EXTERNAL%" ( + mkdir "%LR_EXTERNAL%" && + mkdir "%LR_EXTERNAL%\lib" && + mkdir "%LR_EXTERNAL%\include" + ) + - if not exist c:\hererocks ( + pip install hererocks && + hererocks c:\hererocks --%LUA% --target %HR_TARGET% -rlatest && + call c:\hererocks\bin\activate + ) before_build: # external deps @@ -45,11 +51,11 @@ build_script: before_test: # test deps - - luarocks install lunitx - - luarocks install dkjson - - luarocks install luafilesystem - - if "%LUA_SHORTV%"=="5.1" luarocks install bit32 - - luarocks install lua-path + - if "%LUA%"=="lua 5.1" luarocks show bit32 >nul 2>&1 || luarocks install bit32 + - luarocks show lunitx >nul 2>&1 || luarocks install lunitx + - luarocks show dkjson >nul 2>&1 || luarocks install dkjson + - luarocks show luafilesystem >nul 2>&1 || luarocks install luafilesystem + - luarocks show lua-path >nul 2>&1 || luarocks install lua-path test_script: - echo "Testing..." diff --git a/src/lcerr_easy.h b/src/lcerr_easy.h index 3c8cd4c..8450ed4 100644 --- a/src/lcerr_easy.h +++ b/src/lcerr_easy.h @@ -8,7 +8,11 @@ ERR_ENTRY ( NOT_BUILT_IN ) ERR_ENTRY ( COULDNT_RESOLVE_PROXY ) ERR_ENTRY ( COULDNT_RESOLVE_HOST ) ERR_ENTRY ( COULDNT_CONNECT ) +#if LCURL_CURL_VER_GE(7,51,0) +ERR_ENTRY ( WEIRD_SERVER_REPLY ) +#else ERR_ENTRY ( FTP_WEIRD_SERVER_REPLY ) +#endif ERR_ENTRY ( REMOTE_ACCESS_DENIED ) #if LCURL_CURL_VER_GE(7,31,0) ERR_ENTRY ( FTP_ACCEPT_FAILED ) diff --git a/src/lcerror.c b/src/lcerror.c index 29f7672..a130d9f 100644 --- a/src/lcerror.c +++ b/src/lcerror.c @@ -278,6 +278,15 @@ static const lcurl_const_t lcurl_error_codes[] = { #include "lcerr_easy.h" #undef ERR_ENTRY +/* libcurl rename CURLE_FTP_WEIRD_SERVER_REPLY to CURLE_WEIRD_SERVER_REPLY in version 7.51.0*/ +/* we can not have both codes in general because we have to be able convern error number to error name*/ +/* so we use newest name but add error code as alias.*/ +#if LCURL_CURL_VER_GE(7,51,0) + { "E_FTP_WEIRD_SERVER_REPLY", CURLE_FTP_WEIRD_SERVER_REPLY }, +#else + { "E_WEIRD_SERVER_REPLY", CURLE_FTP_WEIRD_SERVER_REPLY }, +#endif + #define ERR_ENTRY(N) { "E_MULTI_"#N, CURLM_##N }, #include "lcerr_multi.h" #undef ERR_ENTRY diff --git a/src/lcopteasy.h b/src/lcopteasy.h index e6d4773..b5531cf 100644 --- a/src/lcopteasy.h +++ b/src/lcopteasy.h @@ -30,6 +30,11 @@ # define LCURL_DEFAULT_VALUE 0 #endif +#ifdef TCP_FASTOPEN +# define LCURL__TCP_FASTOPEN TCP_FASTOPEN +# undef TCP_FASTOPEN +#endif + OPT_ENTRY( verbose, VERBOSE, LNG, 0, LCURL_DEFAULT_VALUE ) OPT_ENTRY( header, HEADER, LNG, 0, LCURL_DEFAULT_VALUE ) OPT_ENTRY( noprogress, NOPROGRESS, LNG, 0, 1 ) @@ -342,11 +347,18 @@ OPT_ENTRY( stream_weight, STREAM_WEIGHT, LNG, 0, LCUR #if LCURL_CURL_VER_GE(7,48,0) OPT_ENTRY( tftp_no_options, TFTP_NO_OPTIONS, LNG, 0, LCURL_DEFAULT_VALUE ) #endif - #if LCURL_CURL_VER_GE(7,49,0) OPT_ENTRY( tcp_fastopen, TCP_FASTOPEN, LNG, 0, LCURL_DEFAULT_VALUE ) OPT_ENTRY( connect_to, CONNECT_TO, LST, 0, LCURL_DEFAULT_VALUE ) #endif +#if LCURL_CURL_VER_GE(7,51,0) +OPT_ENTRY( keep_sending_on_error, KEEP_SENDING_ON_ERROR, LNG, 0, LCURL_DEFAULT_VALUE ) +#endif + +#ifdef LCURL__TCP_FASTOPEN +# define TCP_FASTOPEN LCURL__TCP_FASTOPEN +# undef LCURL__TCP_FASTOPEN +#endif #ifdef OPT_ENTRY_IS_NULL # undef OPT_ENTRY @@ -355,4 +367,3 @@ OPT_ENTRY( connect_to, CONNECT_TO, LST, 0, LCUR #ifdef FLG_ENTRY_IS_NULL # undef FLG_ENTRY #endif - diff --git a/test/run.lua b/test/run.lua index 4bb5057..44a694b 100644 --- a/test/run.lua +++ b/test/run.lua @@ -12,7 +12,8 @@ local ok, curl = pcall(require, "cURL") local version if ok then version = curl.version() else - version = "" + io.stderr:write('can not load cURL:' .. curl) + os.exit(-1) end print("------------------------------------")