Skip to content

Commit a2c3708

Browse files
committed
Add. Support new options from libcurl 7.62.0
1 parent 12909fd commit a2c3708

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-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.61.0
10+
CURL_VER: 7.62.0
1111

1212
matrix:
1313
- LUA: "lua 5.1"

src/lceasy.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,20 @@ static int lcurl_easy_mime(lua_State *L){
291291

292292
#endif
293293

294+
#if LCURL_CURL_VER_GE(7,62,0)
295+
296+
static int lcurl_easy_upkeep(lua_State *L){
297+
lcurl_easy_t *p = lcurl_geteasy(L);
298+
CURLcode code = curl_easy_upkeep(p->curl);
299+
if(code == CURLE_OK){
300+
lua_settop(L, 1);
301+
return 1;
302+
}
303+
return lcurl_fail_ex(L, p->err_mode, LCURL_ERROR_EASY, code);
304+
}
305+
306+
#endif
307+
294308
//{ OPTIONS
295309

296310
//{ set
@@ -1760,6 +1774,7 @@ static const struct luaL_Reg lcurl_easy_methods[] = {
17601774
{ "escape", lcurl_easy_escape },
17611775
{ "unescape", lcurl_easy_unescape },
17621776
{ "perform", lcurl_easy_perform },
1777+
{ "upkeep", lcurl_easy_upkeep },
17631778
{ "close", lcurl_easy_cleanup },
17641779
{ "__gc", lcurl_easy_cleanup },
17651780
{ "__tostring", lcurl_easy_to_s },

src/lcerr_easy.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ ERR_ENTRY ( RECV_ERROR )
7171
ERR_ENTRY ( OBSOLETE57 )
7272
ERR_ENTRY ( SSL_CERTPROBLEM )
7373
ERR_ENTRY ( SSL_CIPHER )
74+
#if LCURL_CURL_VER_GE(7,62,0)
75+
ERR_ENTRY ( OBSOLETE51 )
76+
#else
7477
ERR_ENTRY ( SSL_CACERT )
78+
#endif
7579
ERR_ENTRY ( BAD_CONTENT_ENCODING )
7680
ERR_ENTRY ( LDAP_INVALID_URL )
7781
ERR_ENTRY ( FILESIZE_EXCEEDED )

src/lcopteasy.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,13 @@ OPT_ENTRY(proxy_tls13_ciphers, PROXY_TLS13_CIPHERS, STR, 0, LCURL_DEFA
450450
OPT_ENTRY(tls13_ciphers, TLS13_CIPHERS, STR, 0, LCURL_DEFAULT_VALUE)
451451
#endif
452452

453+
#if LCURL_CURL_VER_GE(7,61,0)
454+
OPT_ENTRY(upkeep_interval_ms, UPKEEP_INTERVAL_MS, LNG, 0, CURL_UPKEEP_INTERVAL_DEFAULT)
455+
OPT_ENTRY(doh_url, DOH_URL, STR, 0, LCURL_DEFAULT_VALUE)
456+
// thre no named value for default value. It just defined as 64kB in documentation
457+
OPT_ENTRY(upload_buffersize, UPLOAD_BUFFERSIZE, LNG, 0, 64 * 1024)
458+
#endif
459+
453460
//{ Restore system macros
454461

455462
#ifdef LCURL__TCP_FASTOPEN

src/lua/cURL/impl/cURL.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ Easy.setopt_httpauth = wrap_setopt_flags("httpauth", {
381381
["ONLY" ] = curl.AUTH_ONLY;
382382
["ANY" ] = curl.AUTH_ANY;
383383
["ANYSAFE" ] = curl.AUTH_ANYSAFE;
384+
["BEARER" ] = curl.AUTH_BEARER;
384385
})
385386

386387
Easy.setopt_ssh_auth_types = wrap_setopt_flags("ssh_auth_types", {

0 commit comments

Comments
 (0)