Fix. Wrong set headers on form:add_file() method.
Add. SSL_XXX options.
This commit is contained in:
parent
a4d7806f8f
commit
4510730e37
12
README.md
12
README.md
@ -30,7 +30,7 @@ luarocks install lcurl --server=https://rocks.moonscript.org/dev
|
||||
|
||||
```Lua
|
||||
-- HTTP Get
|
||||
curl:easy()
|
||||
curl.easy()
|
||||
:setopt_url('http://httpbin.org/get')
|
||||
:setopt_httpheader{
|
||||
"X-Test-Header1: Header-Data1",
|
||||
@ -43,7 +43,7 @@ curl:easy()
|
||||
|
||||
```Lua
|
||||
-- HTTP Post
|
||||
curl:easy()
|
||||
curl.easy()
|
||||
:setopt_url('http://posttestserver.com/post.php')
|
||||
:setopt_writefunction(io.write)
|
||||
:setopt_httppost(curl.form() -- lcurl guarantee that form will be alive
|
||||
@ -71,7 +71,7 @@ local function get_bin_by(str,n)
|
||||
end
|
||||
end
|
||||
|
||||
curl:easy()
|
||||
curl.easy()
|
||||
:setopt_url("ftp://moteus:123456@127.0.0.1/test.dat")
|
||||
:setopt_upload(true)
|
||||
:setopt_readfunction(
|
||||
@ -85,19 +85,19 @@ curl:easy()
|
||||
-- Multi FTP Upload
|
||||
|
||||
-- We get error E_LOGIN_DENIED for this operation
|
||||
e1 = curl:easy()
|
||||
e1 = curl.easy()
|
||||
:setopt_url("ftp://moteus:999999@127.0.0.1/test1.dat")
|
||||
:setopt_upload(true)
|
||||
:setopt_readfunction(
|
||||
function(t) return table.remove(t) end, {"1111", "2222"}
|
||||
)
|
||||
|
||||
e2 = curl:easy()
|
||||
e2 = curl.easy()
|
||||
:setopt_url("ftp://moteus:123456@127.0.0.1/test2.dat")
|
||||
:setopt_upload(true)
|
||||
:setopt_readfunction(get_bin_by(("e"):rep(1000), 5))
|
||||
|
||||
m = curl:multi()
|
||||
m = curl.multi()
|
||||
m:add_handle(e1)
|
||||
m:add_handle(e2)
|
||||
|
||||
|
@ -106,7 +106,7 @@ static int lcurl_hpost_add_file(lua_State *L){
|
||||
size_t name_len; const char *name = luaL_checklstring(L, 2, &name_len);
|
||||
const char *path = luaL_checkstring(L, 3);
|
||||
const char *type = 0, *fname = 0;
|
||||
struct curl_slist *list;
|
||||
struct curl_slist *list = NULL;
|
||||
struct curl_forms forms[3];
|
||||
CURLFORMcode code;
|
||||
int i = 0;
|
||||
|
@ -179,3 +179,20 @@ OPT_ENTRY( new_file_perms, NEW_FILE_PERMS, LNG, 0)
|
||||
OPT_ENTRY( new_directory_perms, NEW_DIRECTORY_PERMS, LNG, 0)
|
||||
|
||||
OPT_ENTRY( telnetoptions, TELNETOPTIONS, LST, 0)
|
||||
|
||||
OPT_ENTRY(sslcert, SSLCERT, STR, LCURL_STORE_STRING )
|
||||
OPT_ENTRY(sslcerttype, SSLCERTTYPE, STR, LCURL_STORE_STRING )
|
||||
OPT_ENTRY(sslengine, SSLENGINE, STR, LCURL_STORE_STRING )
|
||||
OPT_ENTRY(sslengine_default, SSLENGINE_DEFAULT, LNG, 0 )
|
||||
OPT_ENTRY(sslkey, SSLKEY, STR, LCURL_STORE_STRING )
|
||||
OPT_ENTRY(sslkeytype, SSLKEYTYPE, STR, LCURL_STORE_STRING )
|
||||
OPT_ENTRY(sslversion, SSLVERSION, LNG, 0 )
|
||||
OPT_ENTRY(ssl_cipher_list, SSL_CIPHER_LIST, STR, LCURL_STORE_STRING )
|
||||
// OPT_ENTRY(ssl_ctx_data, SSL_CTX_DATA, 0 ) //! @todo
|
||||
// OPT_ENTRY(ssl_ctx_function, SSL_CTX_FUNCTION, 0 ) //! @todo
|
||||
OPT_ENTRY(ssl_enable_alpn, SSL_ENABLE_ALPN, LNG, 0 )
|
||||
OPT_ENTRY(ssl_enable_npn, SSL_ENABLE_NPN, LNG, 0 )
|
||||
OPT_ENTRY(ssl_options, SSL_OPTIONS, LNG, 0 )
|
||||
OPT_ENTRY(ssl_sessionid_cache, SSL_SESSIONID_CACHE, LNG, 0 )
|
||||
OPT_ENTRY(ssl_verifyhost, SSL_VERIFYHOST, LNG, 0 )
|
||||
OPT_ENTRY(ssl_verifypeer, SSL_VERIFYPEER, LNG, 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user