Merge pull request #86 from moteus/master

Add. Support cURL 7.51.0
This commit is contained in:
Alexey Melnichuk 2016-12-15 16:01:31 +03:00 committed by GitHub
commit fc476eb479
5 changed files with 55 additions and 24 deletions

View File

@ -6,32 +6,38 @@ os:
shallow_clone: true shallow_clone: true
environment: environment:
LUAROCKS_VER: 2.2.1 LR_EXTERNAL: c:\external
CURL_VER: 7.50.1 CURL_VER: 7.51.0
matrix: matrix:
- LUA_VER: 5.1.5 - LUA: "lua 5.1"
- LUA_VER: 5.2.4 - LUA: "lua 5.2"
- LUA_VER: 5.3.0 - LUA: "lua 5.3"
# - LJ_VER: 2.0.3
# - LJ_VER: 2.1
platform: platform:
- x64 - x64
- x86 - x86
# - mingw
cache: cache:
- c:\lua -> appveyor.yml - c:\hererocks -> 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%
install: install:
# Setup Lua development/build environment - set PATH=C:\Python27\Scripts;%LR_EXTERNAL%;%PATH%
- call .appveyor\install.bat - 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: before_build:
# external deps # external deps
@ -45,11 +51,11 @@ build_script:
before_test: before_test:
# test deps # test deps
- luarocks install lunitx - if "%LUA%"=="lua 5.1" luarocks show bit32 >nul 2>&1 || luarocks install bit32
- luarocks install dkjson - luarocks show lunitx >nul 2>&1 || luarocks install lunitx
- luarocks install luafilesystem - luarocks show dkjson >nul 2>&1 || luarocks install dkjson
- if "%LUA_SHORTV%"=="5.1" luarocks install bit32 - luarocks show luafilesystem >nul 2>&1 || luarocks install luafilesystem
- luarocks install lua-path - luarocks show lua-path >nul 2>&1 || luarocks install lua-path
test_script: test_script:
- echo "Testing..." - echo "Testing..."

View File

@ -8,7 +8,11 @@ ERR_ENTRY ( NOT_BUILT_IN )
ERR_ENTRY ( COULDNT_RESOLVE_PROXY ) ERR_ENTRY ( COULDNT_RESOLVE_PROXY )
ERR_ENTRY ( COULDNT_RESOLVE_HOST ) ERR_ENTRY ( COULDNT_RESOLVE_HOST )
ERR_ENTRY ( COULDNT_CONNECT ) ERR_ENTRY ( COULDNT_CONNECT )
#if LCURL_CURL_VER_GE(7,51,0)
ERR_ENTRY ( WEIRD_SERVER_REPLY )
#else
ERR_ENTRY ( FTP_WEIRD_SERVER_REPLY ) ERR_ENTRY ( FTP_WEIRD_SERVER_REPLY )
#endif
ERR_ENTRY ( REMOTE_ACCESS_DENIED ) ERR_ENTRY ( REMOTE_ACCESS_DENIED )
#if LCURL_CURL_VER_GE(7,31,0) #if LCURL_CURL_VER_GE(7,31,0)
ERR_ENTRY ( FTP_ACCEPT_FAILED ) ERR_ENTRY ( FTP_ACCEPT_FAILED )

View File

@ -278,6 +278,15 @@ static const lcurl_const_t lcurl_error_codes[] = {
#include "lcerr_easy.h" #include "lcerr_easy.h"
#undef ERR_ENTRY #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 }, #define ERR_ENTRY(N) { "E_MULTI_"#N, CURLM_##N },
#include "lcerr_multi.h" #include "lcerr_multi.h"
#undef ERR_ENTRY #undef ERR_ENTRY

View File

@ -30,6 +30,11 @@
# define LCURL_DEFAULT_VALUE 0 # define LCURL_DEFAULT_VALUE 0
#endif #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( verbose, VERBOSE, LNG, 0, LCURL_DEFAULT_VALUE )
OPT_ENTRY( header, HEADER, LNG, 0, LCURL_DEFAULT_VALUE ) OPT_ENTRY( header, HEADER, LNG, 0, LCURL_DEFAULT_VALUE )
OPT_ENTRY( noprogress, NOPROGRESS, LNG, 0, 1 ) 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) #if LCURL_CURL_VER_GE(7,48,0)
OPT_ENTRY( tftp_no_options, TFTP_NO_OPTIONS, LNG, 0, LCURL_DEFAULT_VALUE ) OPT_ENTRY( tftp_no_options, TFTP_NO_OPTIONS, LNG, 0, LCURL_DEFAULT_VALUE )
#endif #endif
#if LCURL_CURL_VER_GE(7,49,0) #if LCURL_CURL_VER_GE(7,49,0)
OPT_ENTRY( tcp_fastopen, TCP_FASTOPEN, LNG, 0, LCURL_DEFAULT_VALUE ) OPT_ENTRY( tcp_fastopen, TCP_FASTOPEN, LNG, 0, LCURL_DEFAULT_VALUE )
OPT_ENTRY( connect_to, CONNECT_TO, LST, 0, LCURL_DEFAULT_VALUE ) OPT_ENTRY( connect_to, CONNECT_TO, LST, 0, LCURL_DEFAULT_VALUE )
#endif #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 #ifdef OPT_ENTRY_IS_NULL
# undef OPT_ENTRY # undef OPT_ENTRY
@ -355,4 +367,3 @@ OPT_ENTRY( connect_to, CONNECT_TO, LST, 0, LCUR
#ifdef FLG_ENTRY_IS_NULL #ifdef FLG_ENTRY_IS_NULL
# undef FLG_ENTRY # undef FLG_ENTRY
#endif #endif

View File

@ -12,7 +12,8 @@ local ok, curl = pcall(require, "cURL")
local version if ok then local version if ok then
version = curl.version() version = curl.version()
else else
version = "<UNKNOWN>" io.stderr:write('can not load cURL:' .. curl)
os.exit(-1)
end end
print("------------------------------------") print("------------------------------------")