Release 0.3.8
parent
5347756dec
commit
f36ef258ec
2
LICENSE
2
LICENSE
|
@ -1,6 +1,6 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017 Alexey Melnichuk
|
||||
Copyright (c) 2014-2018 Alexey Melnichuk
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -5,8 +5,6 @@ local curl = require "cURL"
|
|||
local easy = curl.easy()
|
||||
|
||||
-- Create new mime object.
|
||||
-- cURL documentation doesn not mentioned that
|
||||
-- this mime object can be used only
|
||||
local mime = easy:mime()
|
||||
|
||||
-- Add part. Source of data is file on disk.
|
||||
|
@ -41,12 +39,9 @@ end
|
|||
|
||||
easy:close()
|
||||
|
||||
-- E.g. it does not send filedata second time.
|
||||
-- Lua-cURL does not free mime when close `parent` easy.
|
||||
|
||||
-- Explicitly free mime object and all its parts
|
||||
-- There no way to reuse only some parts.
|
||||
-- There no way to reuse only some parts or submimes.
|
||||
-- but it possible reuse entire mime again.
|
||||
mime:free()
|
||||
|
||||
-- Subparts become also freed
|
||||
print(part)
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
local curl = require "lcurl"
|
||||
|
||||
local function keys(t)
|
||||
local s = {}
|
||||
for k in pairs(t) do
|
||||
s[#s + 1] = k
|
||||
end
|
||||
table.sort(s)
|
||||
return s
|
||||
end
|
||||
|
||||
local function printf(...)
|
||||
return print(string.format(...))
|
||||
end
|
||||
|
||||
local exclude = {protocols = 1, features = 1, version = 1, version_num = 1}
|
||||
|
||||
local info = curl.version_info()
|
||||
|
||||
print(curl.version())
|
||||
|
||||
for _, key in ipairs(keys(info)) do if not exclude[key] then
|
||||
printf("%15s: %s", key, info[key])
|
||||
end end
|
||||
|
||||
print('Protocols:')
|
||||
for _, protocol in ipairs(keys(info.protocols))do
|
||||
local on = info.protocols[protocol]
|
||||
printf(' [%s] %s', on and '+' or '-', protocol)
|
||||
end
|
||||
|
||||
print('Features:')
|
||||
for _, feature in ipairs(keys(info.features))do
|
||||
local on = info.features[feature]
|
||||
printf(' [%s] %s', on and '+' or '-', feature)
|
||||
end
|
|
@ -0,0 +1,74 @@
|
|||
package = "Lua-cURL"
|
||||
version = "0.3.8-1"
|
||||
|
||||
source = {
|
||||
url = "https://github.com/Lua-cURL/Lua-cURLv3/archive/v0.3.8.zip",
|
||||
dir = "Lua-cURLv3-0.3.8",
|
||||
}
|
||||
|
||||
description = {
|
||||
summary = "Lua binding to libcurl",
|
||||
detailed = [[
|
||||
]],
|
||||
homepage = "https://github.com/Lua-cURL",
|
||||
license = "MIT/X11"
|
||||
}
|
||||
|
||||
dependencies = {
|
||||
"lua >= 5.1, < 5.4"
|
||||
}
|
||||
|
||||
external_dependencies = {
|
||||
platforms = {
|
||||
windows = {
|
||||
CURL = {
|
||||
header = "curl/curl.h",
|
||||
library = "libcurl",
|
||||
}
|
||||
};
|
||||
unix = {
|
||||
CURL = {
|
||||
header = "curl/curl.h",
|
||||
-- library = "curl",
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
build = {
|
||||
copy_directories = {'doc', 'examples', 'test'},
|
||||
|
||||
type = "builtin",
|
||||
|
||||
platforms = {
|
||||
windows = { modules = {
|
||||
lcurl = {
|
||||
libraries = {"libcurl", "ws2_32"},
|
||||
}
|
||||
}},
|
||||
unix = { modules = {
|
||||
lcurl = {
|
||||
libraries = {"curl"},
|
||||
}
|
||||
}}
|
||||
},
|
||||
|
||||
modules = {
|
||||
["cURL" ] = "src/lua/cURL.lua",
|
||||
["cURL.safe" ] = "src/lua/cURL/safe.lua",
|
||||
["cURL.utils" ] = "src/lua/cURL/utils.lua",
|
||||
["cURL.impl.cURL" ] = "src/lua/cURL/impl/cURL.lua",
|
||||
|
||||
lcurl = {
|
||||
sources = {
|
||||
"src/l52util.c", "src/lceasy.c", "src/lcerror.c",
|
||||
"src/lchttppost.c", "src/lcurl.c", "src/lcutils.c",
|
||||
"src/lcmulti.c", "src/lcshare.c",
|
||||
},
|
||||
incdirs = { "$(CURL_INCDIR)" },
|
||||
libdirs = { "$(CURL_LIBDIR)" }
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
--
|
||||
-- Author: Alexey Melnichuk <alexeymelnichuck@gmail.com>
|
||||
--
|
||||
-- Copyright (C) 2014-2017 Alexey Melnichuk <alexeymelnichuck@gmail.com>
|
||||
-- Copyright (C) 2014-2018 Alexey Melnichuk <alexeymelnichuck@gmail.com>
|
||||
--
|
||||
-- Licensed according to the included 'LICENSE' document
|
||||
--
|
||||
|
@ -10,9 +10,9 @@
|
|||
|
||||
local module_info = {
|
||||
_NAME = "Lua-cURL";
|
||||
_VERSION = "0.3.8-dev";
|
||||
_VERSION = "0.3.8";
|
||||
_LICENSE = "MIT";
|
||||
_COPYRIGHT = "Copyright (c) 2014-2017 Alexey Melnichuk";
|
||||
_COPYRIGHT = "Copyright (c) 2014-2018 Alexey Melnichuk";
|
||||
}
|
||||
|
||||
local function hash_id(str)
|
||||
|
|
Loading…
Reference in New Issue