[Tarantool-patches] [PATCH 2/3] build: enable smtp in libCURL
Roman Khabibov
roman.habibov at tarantool.org
Fri Apr 9 22:54:36 MSK 2021
> On Apr 1, 2021, at 03:52, Alexander Turenko <alexander.turenko at tarantool.org> wrote:
>
> On Fri, Mar 19, 2021 at 05:13:07PM +0300, Roman Khabibov wrote:
>> Enable smtp protocol in bundled libCURL.
>> ---
>> cmake/BuildLibCURL.cmake | 2 +-
>> test/box-tap/curl-build.test.lua | 38 +++++++++++++++++++++++++++++++-
>> 2 files changed, 38 insertions(+), 2 deletions(-)
>>
>> diff --git a/cmake/BuildLibCURL.cmake b/cmake/BuildLibCURL.cmake
>> index 5f8b15a63..313adfb97 100644
>> --- a/cmake/BuildLibCURL.cmake
>> +++ b/cmake/BuildLibCURL.cmake
>> @@ -124,6 +124,7 @@ macro(curl_build)
>> --enable-http-auth
>> --enable-mime
>> --enable-dateparse
>> + --enable-smtp
>>
>> ${DISABLED_DNS_OPT}
>> --disable-ftp
>> @@ -137,7 +138,6 @@ macro(curl_build)
>> --disable-pop3
>> --disable-imap
>> --disable-smb
>> - --disable-smtp
>> --disable-gopher
>> --disable-manual
>> --disable-sspi
>
> It seems, it is quite straightforward backport of [1], so it is okay
> after comments from the original patch ([2]).
>
> Don't miss changelog entries on 1.10.
>
> [1]: https://lists.tarantool.org/pipermail/tarantool-patches/2021-March/022797.html
> [2]: https://lists.tarantool.org/pipermail/tarantool-patches/2021-March/023177.html
>
> I performed tests 2 and 3 from [2] and the result looks the same. It
> seems, we don't enable or disable something unintentionally here as
> well.
>
> WBR, Alexander Turenko.
commit 41fb2d2ae39007ee47d90c49de77120c337ee267
Author: Roman Khabibov <roman.habibov at tarantool.org>
Date: Mon Jan 18 21:48:35 2021 +0300
build: enable smtp in libcurl
Enable smtp protocol in bundled libcurl.
Part of #4559
diff --git a/cmake/BuildLibCURL.cmake b/cmake/BuildLibCURL.cmake
index 5f8b15a63..313adfb97 100644
--- a/cmake/BuildLibCURL.cmake
+++ b/cmake/BuildLibCURL.cmake
@@ -124,6 +124,7 @@ macro(curl_build)
--enable-http-auth
--enable-mime
--enable-dateparse
+ --enable-smtp
${DISABLED_DNS_OPT}
--disable-ftp
@@ -137,7 +138,6 @@ macro(curl_build)
--disable-pop3
--disable-imap
--disable-smb
- --disable-smtp
--disable-gopher
--disable-manual
--disable-sspi
diff --git a/test/box-tap/curl-build.test.lua b/test/box-tap/curl-build.test.lua
index 300d60b07..640d5d143 100755
--- a/test/box-tap/curl-build.test.lua
+++ b/test/box-tap/curl-build.test.lua
@@ -56,7 +56,7 @@ ffi.cdef([[
local info = ffi.C.curl_version_info(7)
local test = tap.test('curl-features')
-test:plan(3)
+test:plan(5)
if test:ok(info.ssl_version ~= nil, 'Curl built with SSL support') then
test:diag('ssl_version: ' .. ffi.string(info.ssl_version))
@@ -174,4 +174,29 @@ test:test('curl_symbols', function(t)
end
end)
+local function has_protocol(protocol_str)
+ local i = 0
+ -- curl_version_info_data.protocols is a null terminated array
+ -- of pointers to char.
+ -- See curl/lib/version.c:
+ -- static const char * const protocols[]
+ local info = ffi.C.curl_version_info(7)
+ local protocol = info.protocols[i]
+ while protocol ~= nil do
+ if ffi.string(protocol) == protocol_str then
+ return true
+ end
+ i = i + 1
+ protocol = info.protocols[i]
+ end
+
+ return false
+end
+
+--
+-- gh-4559: check if smtp and smtps protocols are enabled.
+--
+test:ok(has_protocol('smtp'), 'smtp protocol is supported')
+test:ok(has_protocol('smtps'), 'smtps protocol is supported')
+
os.exit(test:check() and 0 or 1)
More information about the Tarantool-patches
mailing list