From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id C6CA76EC56; Fri, 19 Mar 2021 17:14:13 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C6CA76EC56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1616163253; bh=8PzJLG3PjnWkzAy4MJfbqRO+KHYUNeVMjNVQYKLFF9E=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=x9Yt+xKVhkhHKKr8K4ACVFK1bdVPIQfotg94laBspEYKwGEKpD9ZcTQSeeHeG6k8D TCHdr79ztCG8lY8lpkdfntfUVKU6C0Xr+bivdtpXfeCa6WErp6UhurVR59KDmHl9tB OPuJ5VYnEd8uRVwk7A4/069ljQTqXirnaFlNzjlU= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id E45486EC57 for ; Fri, 19 Mar 2021 17:13:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E45486EC57 Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lNFsG-0002rZ-Ah; Fri, 19 Mar 2021 17:13:12 +0300 To: tarantool-patches@dev.tarantool.org Cc: alexander.turenko@tarantool.org Date: Fri, 19 Mar 2021 17:13:07 +0300 Message-Id: <20210319141308.98726-3-roman.habibov@tarantool.org> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20210319141308.98726-1-roman.habibov@tarantool.org> References: <20210319141308.98726-1-roman.habibov@tarantool.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: EEAE043A70213CC8 X-77F55803: 4F1203BC0FB41BD95D6E7CC48CB1F5F111116110879554077ED795A4341E98F3182A05F538085040DAF8EDA35284F863D597F86DB7C53A0BEAC15A12DECE1B8FE3744CA9267979CB X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE71BDE6A359BD5B800EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376A27C8034CCD05E58638F802B75D45FF914D58D5BE9E6BC131B5C99E7648C95C81A23F326053F8273F8D59B0545EA30A1B9F4DAE8952F511A471835C12D1D9774AD6D5ED66289B5278DA827A17800CE767883B903EA3BAEA9FA2833FD35BB23D2EF20D2F80756B5F868A13BD56FB6657A471835C12D1D977725E5C173C3A84C3E97D2AE7161E217F117882F4460429728AD0CFFFB425014E868A13BD56FB6657A7F4EDE966BC389F9E8FC8737B5C224927FB1C3B46BEE1FF089D37D7C0E48F6CCF19DD082D7633A0E7DDDDC251EA7DABAAAE862A0553A39223F8577A6DFFEA7CCC610B09C563F4C143847C11F186F3C5E7DDDDC251EA7DABCC89B49CDF41148FA8EF81845B15A4842623479134186CDE6BA297DBC24807EABDAD6C7F3747799A X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975C81A23F326053F8273F8D59B0545EA30A1B9F4DAE8952F5119C2B6934AE262D3EE7EAB7254005DCED7532B743992DF240BDC6A1CF3F042BAD6DF99611D93F60EF0417BEADF48D1460699F904B3F4130E343918A1A30D5E7FCCB5012B2E24CD356 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D343D1F112031EF3D628F1150F2653202B6AE92C116AC7CDD2BAC0B5FB4CE3A02FDBB2D559FCD3BF2B61D7E09C32AA3244C0CDE0AC1AAB59BA37E3E9BA23AE81F5CC86C126E7119A0FE729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojyKyJYJ15DtIeJAOX8QbL8A== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638225C5E7D543D587F6E9B124D34EB8C03240F96A0E8EF440D4CA021B31A5B48C7CFFB559BB5D741EB9609AE011F3211FEEF240331F90058701C67EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH 2/3] build: enable smtp in libCURL X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Roman Khabibov via Tarantool-patches Reply-To: Roman Khabibov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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)