Tarantool development patches archive
 help / color / mirror / Atom feed
From: Roman Khabibov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: tarantool-patches@dev.tarantool.org
Cc: alexander.turenko@tarantool.org
Subject: [Tarantool-patches] [PATCH 2/3] build: enable smtp in libCURL
Date: Fri, 19 Mar 2021 17:13:07 +0300	[thread overview]
Message-ID: <20210319141308.98726-3-roman.habibov@tarantool.org> (raw)
In-Reply-To: <20210319141308.98726-1-roman.habibov@tarantool.org>

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
diff --git a/test/box-tap/curl-build.test.lua b/test/box-tap/curl-build.test.lua
index ab58efffa..e4ec49c19 100755
--- a/test/box-tap/curl-build.test.lua
+++ b/test/box-tap/curl-build.test.lua
@@ -4,10 +4,22 @@ local tap = require('tap')
 local ffi = require('ffi')
 ffi.cdef([[
     void *dlsym(void *handle, const char *symbol);
+    struct curl_version_info_data {
+        int age;                  /* see description below */
+        const char *version;      /* human readable string */
+        unsigned int version_num; /* numeric representation */
+        const char *host;         /* human readable string */
+        int features;             /* bitmask, see below */
+        char *ssl_version;        /* human readable string */
+        long ssl_version_num;     /* not used, always zero */
+        const char *libz_version; /* human readable string */
+        const char * const *protocols; /* protocols */
+    };
+    struct curl_version_info_data *curl_version_info(int age);
 ]])
 
 local test = tap.test('curl-symbols')
-test:plan(1)
+test:plan(2)
 
 local RTLD_DEFAULT
 -- See `man 3 dlsym`:
@@ -121,4 +133,28 @@ test:test('curl_symbols', function(t)
     end
 end)
 
+--
+-- Check if smtp protocol is enabled.
+--
+local function has_smtp()
+    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) == 'smtp' then
+            return true
+        end
+        i = i + 1
+        protocol = info.protocols[i]
+    end
+
+    return false
+end
+
+test:ok(has_smtp(), 'smtp protocol is supported')
+
 os.exit(test:check() and 0 or 1)
-- 
2.24.3 (Apple Git-128)


  parent reply	other threads:[~2021-03-19 14:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-19 14:13 [Tarantool-patches] [PATCH 0/3] Export curl symbols, enable smtp and install headers Roman Khabibov via Tarantool-patches
2021-03-19 14:13 ` [Tarantool-patches] [PATCH 1/3] build: export libCURL symbols Roman Khabibov via Tarantool-patches
2021-03-31 23:56   ` Alexander Turenko via Tarantool-patches
2021-04-09 19:54     ` Roman Khabibov via Tarantool-patches
2021-04-01  0:01   ` Alexander Turenko via Tarantool-patches
2021-03-19 14:13 ` Roman Khabibov via Tarantool-patches [this message]
2021-04-01  0:52   ` [Tarantool-patches] [PATCH 2/3] build: enable smtp in libCURL Alexander Turenko via Tarantool-patches
2021-04-09 19:54     ` Roman Khabibov via Tarantool-patches
2021-03-19 14:13 ` [Tarantool-patches] [PATCH 3/3] build: install libCURL headers Roman Khabibov via Tarantool-patches
2021-04-01  0:10   ` Alexander Turenko via Tarantool-patches
2021-04-09 19:54     ` Roman Khabibov via Tarantool-patches
2021-04-13 13:14 ` [Tarantool-patches] [PATCH 0/3] Export curl symbols, enable smtp and install headers Leonid Vasiliev via Tarantool-patches
2021-04-14 17:52   ` Roman Khabibov via Tarantool-patches
  -- strict thread matches above, loose matches on Subject: below --
2021-03-18  8:51 [Tarantool-patches] [PATCH 0/3] Install iibCURL headers and export libCURL symbols for 1.10 Roman Khabibov via Tarantool-patches
2021-03-18  8:51 ` [Tarantool-patches] [PATCH 2/3] build: enable smtp in libCURL Roman Khabibov via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210319141308.98726-3-roman.habibov@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=roman.habibov@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 2/3] build: enable smtp in libCURL' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox