Skip to content

Commit d1b6b86

Browse files
authored
Merge pull request #111 from moteus/master
Support libcurl 7.55.1
2 parents 7f3bd8b + 899f4e9 commit d1b6b86

File tree

6 files changed

+40
-1
lines changed

6 files changed

+40
-1
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ shallow_clone: true
77

88
environment:
99
LR_EXTERNAL: c:\external
10-
CURL_VER: 7.54.0
10+
CURL_VER: 7.55.1
1111

1212
matrix:
1313
- LUA: "lua 5.1"

src/lceasy.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,23 @@ static int lcurl_info_get_double_(lua_State *L, int opt){
813813
return 1;
814814
}
815815

816+
#if LCURL_CURL_VER_GE(7,55,0)
817+
818+
static int lcurl_info_get_offset_(lua_State *L, int opt){
819+
lcurl_easy_t *p = lcurl_geteasy(L);
820+
curl_off_t val; CURLcode code;
821+
822+
code = curl_easy_getinfo(p->curl, opt, &val);
823+
if(code != CURLE_OK){
824+
return lcurl_fail_ex(L, p->err_mode, LCURL_ERROR_EASY, code);
825+
}
826+
827+
lutil_pushint64(L, val);
828+
return 1;
829+
}
830+
831+
#endif
832+
816833
static int lcurl_info_get_string_(lua_State *L, int opt){
817834
lcurl_easy_t *p = lcurl_geteasy(L);
818835
char *val; CURLcode code;
@@ -890,6 +907,10 @@ static int lcurl_info_get_certinfo_(lua_State *L, int opt){
890907
return lcurl_info_get_double_(L, CURLINFO_##N);\
891908
}
892909

910+
#define LCURL_OFF_INFO(N, S) static int lcurl_easy_get_##N(lua_State *L){\
911+
return lcurl_info_get_offset_(L, CURLINFO_##N);\
912+
}
913+
893914
#define LCURL_CERTINFO_INFO(N, S) static int lcurl_easy_get_##N(lua_State *L){\
894915
return lcurl_info_get_certinfo_(L, CURLINFO_##N);\
895916
}

src/lcflags.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ FLG_ENTRY(AUTH_ONLY )
1818
#endif
1919
FLG_ENTRY(AUTH_ANY )
2020
FLG_ENTRY(AUTH_ANYSAFE )
21+
#if LCURL_CURL_VER_GE(7,55,0)
22+
FLG_ENTRY(AUTH_GSSAPI )
23+
#endif
2124

2225
#ifdef CURLSSH_AUTH_ANY
2326
FLG_ENTRY(SSH_AUTH_ANY )

src/lcinfoeasy.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ OPT_ENTRY( protocol, PROTOCOL, LNG, 0)
5454
OPT_ENTRY( scheme, SCHEME, STR, 0)
5555
#endif
5656

57+
#if LCURL_CURL_VER_GE(7,55,0)
58+
OPT_ENTRY( content_length_download_t, CONTENT_LENGTH_DOWNLOAD_T, OFF, 0)
59+
OPT_ENTRY( content_length_upload_t, CONTENT_LENGTH_UPLOAD_T, OFF, 0)
60+
OPT_ENTRY( size_download_t, SIZE_DOWNLOAD_T, OFF, 0)
61+
OPT_ENTRY( size_upload_t, SIZE_UPLOAD_T, OFF, 0)
62+
OPT_ENTRY( speed_download_t, SPEED_DOWNLOAD_T, OFF, 0)
63+
OPT_ENTRY( speed_upload_t, SPEED_UPLOAD_T, OFF, 0)
64+
#endif
65+
5766
// OPT_ENTRY( PRIVATE, void )
5867
// OPT_ENTRY( TLS_SSL_PTR, struct curl_tlssessioninfo **
5968
// OPT_ENTRY( TLS_SESSION, struct curl_tlssessioninfo *

src/lcopteasy.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@ OPT_ENTRY( abstract_unix_socket, ABSTRACT_UNIX_SOCKET, STR, 0, LCURL_DEFAULT_
396396
OPT_ENTRY( suppress_connect_headers, SUPPRESS_CONNECT_HEADERS, LNG, 0, LCURL_DEFAULT_VALUE)
397397
#endif
398398

399+
#if LCURL_CURL_VER_GE(7,55,0)
400+
OPT_ENTRY( request_target, REQUEST_TARGET, STR, 0, LCURL_DEFAULT_VALUE)
401+
OPT_ENTRY( socks5_auth, SOCKS5_AUTH, LNG, 0, LCURL_DEFAULT_VALUE)
402+
#endif
403+
399404
#ifdef LCURL__TCP_FASTOPEN
400405
# define TCP_FASTOPEN LCURL__TCP_FASTOPEN
401406
# undef LCURL__TCP_FASTOPEN

src/lua/cURL/impl/cURL.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ Easy.setopt_httpauth = wrap_setopt_flags("httpauth", {
376376
["NEGOTIATE" ] = curl.AUTH_NEGOTIATE;
377377
["NTLM" ] = curl.AUTH_NTLM;
378378
["DIGEST_IE" ] = curl.AUTH_DIGEST_IE;
379+
["GSSAPI" ] = curl.AUTH_GSSAPI;
379380
["NTLM_WB" ] = curl.AUTH_NTLM_WB;
380381
["ONLY" ] = curl.AUTH_ONLY;
381382
["ANY" ] = curl.AUTH_ANY;

0 commit comments

Comments
 (0)