]> git.ipfire.org Git - thirdparty/git.git/commit - imap-send.c
git-imap-send: use libcurl for implementation
authorBernhard Reiter <ockham@raz.or.at>
Sun, 9 Nov 2014 14:55:53 +0000 (15:55 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Nov 2014 17:17:27 +0000 (09:17 -0800)
commit1e16b255b95b45374db0b0cf69ef0ecce768ac27
tree5d3107f2f7211c81fefe12849d65aeb246f95462
parentf1a35295c2b66d2501f034d864afb2c5d8bb0e08
git-imap-send: use libcurl for implementation

Use libcurl's high-level API functions to implement git-imap-send
instead of the previous low-level OpenSSL-based functions.

Since version 7.30.0, libcurl's API has been able to communicate with
IMAP servers. Using those high-level functions instead of the current
ones would reduce imap-send.c by some 1200 lines of code. For now,
the old ones are wrapped in #ifdefs, and the new functions are enabled
by make if curl's version is >= 7.34.0, from which version on curl's
CURLOPT_LOGIN_OPTIONS (enabling IMAP authentication) parameter has been
available. The low-level functions will still be used for tunneling
into the server for now.

As I don't have access to that many IMAP servers, I haven't been able to
test the new code with a wide variety of parameter combinations. I did
test both secure and insecure (imaps:// and imap://) connections and
values of "PLAIN" and "LOGIN" for the authMethod.

In order to suppress a sparse warning about "using sizeof on a
function", we use the same solution used in commit 9371322a6
("sparse: suppress some "using sizeof on a function" warnings",
06-10-2013) which solved exactly this problem for the other commands
using libcurl.

Helped-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Bernhard Reiter <ockham@raz.or.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-imap-send.txt
INSTALL
Makefile
imap-send.c