diff --git a/src/lceasy.c b/src/lceasy.c index c8a1eed..41874d3 100644 --- a/src/lceasy.c +++ b/src/lceasy.c @@ -657,7 +657,13 @@ static int lcurl_easy_setopt(lua_State *L){ } #undef OPT_ENTRY - return lcurl_fail_ex(L, p->err_mode, LCURL_ERROR_EASY, CURLE_UNKNOWN_OPTION); + return lcurl_fail_ex(L, p->err_mode, LCURL_ERROR_EASY, +#if LCURL_CURL_VER_GE(7,21,5) + CURLE_UNKNOWN_OPTION +#else + CURLE_UNKNOWN_TELNET_OPTION +#endif + ); } static int lcurl_easy_getinfo(lua_State *L){ diff --git a/src/lcerr_easy.h b/src/lcerr_easy.h index 2ddd56b..ce4dc07 100644 --- a/src/lcerr_easy.h +++ b/src/lcerr_easy.h @@ -50,7 +50,11 @@ ERR_ENTRY ( OBSOLETE44 ) ERR_ENTRY ( INTERFACE_FAILED ) ERR_ENTRY ( OBSOLETE46 ) ERR_ENTRY ( TOO_MANY_REDIRECTS ) +#if LCURL_CURL_VER_GE(7,21,5) ERR_ENTRY ( UNKNOWN_OPTION ) +#else +ERR_ENTRY ( UNKNOWN_TELNET_OPTION ) /* User specified an unknown option */ +#endif ERR_ENTRY ( TELNET_OPTION_SYNTAX ) ERR_ENTRY ( OBSOLETE50 ) ERR_ENTRY ( PEER_FAILED_VERIFICATION ) diff --git a/src/lcinfoeasy.h b/src/lcinfoeasy.h index 575ff32..9e0df1b 100644 --- a/src/lcinfoeasy.h +++ b/src/lcinfoeasy.h @@ -27,17 +27,21 @@ OPT_ENTRY( proxyauth_avail, PROXYAUTH_AVAIL, LNG, 0) OPT_ENTRY( os_errno, OS_ERRNO, LNG, 0) OPT_ENTRY( num_connects, NUM_CONNECTS, LNG, 0) OPT_ENTRY( primary_ip, PRIMARY_IP, STR, 0) +#if LCURL_CURL_VER_GE(7,21,0) OPT_ENTRY( primary_port, PRIMARY_PORT, LNG, 0) OPT_ENTRY( local_ip, LOCAL_IP, STR, 0) OPT_ENTRY( local_port, LOCAL_PORT, LNG, 0) +#endif OPT_ENTRY( cookielist, COOKIELIST, LST, 0) OPT_ENTRY( lastsocket, LASTSOCKET, LNG, 0) OPT_ENTRY( ftp_entry_path, FTP_ENTRY_PATH, STR, 0) OPT_ENTRY( condition_unmet, CONDITION_UNMET, LNG, 0) +#if LCURL_CURL_VER_GE(7,20,0) OPT_ENTRY( rtsp_session_id, RTSP_SESSION_ID, STR, 0) OPT_ENTRY( rtsp_client_cseq, RTSP_CLIENT_CSEQ, LNG, 0) OPT_ENTRY( rtsp_server_cseq, RTSP_SERVER_CSEQ, LNG, 0) OPT_ENTRY( rtsp_cseq_recv, RTSP_CSEQ_RECV, LNG, 0) +#endif // OPT_ENTRY( PRIVATE, void ) // OPT_ENTRY( CERTINFO, struct curl_certinfo * diff --git a/src/lcopteasy.h b/src/lcopteasy.h index e1ddf09..0de6760 100644 --- a/src/lcopteasy.h +++ b/src/lcopteasy.h @@ -30,7 +30,9 @@ OPT_ENTRY( verbose, VERBOSE, LNG, 0 ) OPT_ENTRY( header, HEADER, LNG, 0 ) OPT_ENTRY( noprogress, NOPROGRESS, LNG, 0 ) OPT_ENTRY( nosignal, NOSIGNAL, LNG, 0 ) +#if LCURL_CURL_VER_GE(7,21,0) OPT_ENTRY( wildcardmatch, WILDCARDMATCH, LNG, 0 ) +#endif OPT_ENTRY( url, URL, STR, LCURL_STORE_STRING ) OPT_ENTRY( failonerror, FAILONERROR, LNG, 0 ) @@ -74,9 +76,11 @@ OPT_ENTRY( login_options, LOGIN_OPTIONS, STR, LCURL_STORE_ST OPT_ENTRY( proxyusername, PROXYUSERNAME, STR, LCURL_STORE_STRING ) OPT_ENTRY( proxypassword, PROXYPASSWORD, STR, LCURL_STORE_STRING ) OPT_ENTRY( httpauth, HTTPAUTH, LNG, 0 ) +#if LCURL_CURL_VER_GE(7,21,4) OPT_ENTRY( tlsauth_username, TLSAUTH_USERNAME, STR, LCURL_STORE_STRING ) OPT_ENTRY( tlsauth_password, TLSAUTH_PASSWORD, STR, LCURL_STORE_STRING ) OPT_ENTRY( tlsauth_type, TLSAUTH_TYPE, LNG, 0 ) +#endif OPT_ENTRY( proxyauth, PROXYAUTH, LNG, 0 ) #if LCURL_CURL_VER_GE(7,31,0) OPT_ENTRY( sasl_ir, SASL_IR, LNG, 0 ) @@ -86,8 +90,10 @@ OPT_ENTRY( xoauth2_bearer, XOAUTH2_BEARER, STR, LCURL_STORE_ST #endif OPT_ENTRY( autoreferer, AUTOREFERER, LNG, 0 ) +#if LCURL_CURL_VER_GE(7,21,6) OPT_ENTRY( accept_encoding, ACCEPT_ENCODING, STR, LCURL_STORE_STRING ) OPT_ENTRY( transfer_encoding, TRANSFER_ENCODING, LNG, 0 ) +#endif OPT_ENTRY( followlocation, FOLLOWLOCATION, LNG, 0 ) OPT_ENTRY( unrestricted_auth, UNRESTRICTED_AUTH, LNG, 0 ) OPT_ENTRY( maxredirs, MAXREDIRS, LNG, 0 ) @@ -118,8 +124,10 @@ OPT_ENTRY( http_transfer_decoding, HTTP_TRANSFER_DECODING, LNG, 0 ) OPT_ENTRY( expect_100_timeout_ms, EXPECT_100_TIMEOUT_MS, LNG, 0 ) #endif +#if LCURL_CURL_VER_GE(7,20,0) OPT_ENTRY( mail_from, MAIL_FROM, STR, LCURL_STORE_STRING ) OPT_ENTRY( mail_rcpt, MAIL_RCPT, STR, LCURL_STORE_STRING ) +#endif #if LCURL_CURL_VER_GE(7,25,0) OPT_ENTRY( mail_auth, MAIL_AUTH, STR, LCURL_STORE_STRING ) #endif @@ -134,7 +142,9 @@ OPT_ENTRY( dirlistonly, DIRLISTONLY, LNG, 0 ) OPT_ENTRY( append, APPEND, LNG, 0 ) OPT_ENTRY( ftp_use_eprt, FTP_USE_EPRT, LNG, 0 ) OPT_ENTRY( ftp_use_epsv, FTP_USE_EPSV, LNG, 0 ) +#if LCURL_CURL_VER_GE(7,20,0) OPT_ENTRY( ftp_use_pret, FTP_USE_PRET, LNG, 0 ) +#endif OPT_ENTRY( ftp_create_missing_dirs, FTP_CREATE_MISSING_DIRS, LNG, 0 ) OPT_ENTRY( ftp_response_timeout, FTP_RESPONSE_TIMEOUT, LNG, 0 ) OPT_ENTRY( ftp_alternative_to_user, FTP_ALTERNATIVE_TO_USER, STR, LCURL_STORE_STRING ) @@ -175,7 +185,9 @@ OPT_ENTRY( connecttimeout_ms, CONNECTTIMEOUT_MS, LNG, 0 ) OPT_ENTRY( ipresolve, IPRESOLVE, LNG, 0 ) OPT_ENTRY( connect_only, CONNECT_ONLY, LNG, 0 ) OPT_ENTRY( use_ssl, USE_SSL, LNG, 0 ) +#if LCURL_CURL_VER_GE(7,21,3) OPT_ENTRY( resolve, RESOLVE, LST, 0 ) +#endif #if LCURL_CURL_VER_GE(7,33,0) OPT_ENTRY( dns_interface, DNS_INTERFACE, STR, LCURL_STORE_STRING ) OPT_ENTRY( dns_local_ip4, DNS_LOCAL_IP4, STR, LCURL_STORE_STRING )