summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2015-03-20 13:11:50 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-03-20 13:11:50 -0700
commit0a81977239c1b2aae3aa53c0895267b3ac2d5425 (patch)
tree51a23f87a8592032d96c755a175844ef175603a6
parentMerge branch 'km/bsd-sysctl' (diff)
parentimap-send: use cURL automatically when NO_OPENSSL defined (diff)
downloadtgif-0a81977239c1b2aae3aa53c0895267b3ac2d5425.tar.xz
Merge branch 'km/imap-send-libcurl-options'
"git imap-send" learned to optionally talk with an IMAP server via libcURL; because there is no other option when Git is built with NO_OPENSSL option, use that codepath by default under such configuration. * km/imap-send-libcurl-options: imap-send: use cURL automatically when NO_OPENSSL defined
-rw-r--r--Documentation/git-imap-send.txt3
-rw-r--r--imap-send.c17
2 files changed, 17 insertions, 3 deletions
diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt
index 77aacf1309..5d1e4c80cd 100644
--- a/Documentation/git-imap-send.txt
+++ b/Documentation/git-imap-send.txt
@@ -44,7 +44,8 @@ OPTIONS
--no-curl::
Talk to the IMAP server using git's own IMAP routines instead of
- using libcurl.
+ using libcurl. Ignored if Git was built with the NO_OPENSSL option
+ set.
CONFIGURATION
diff --git a/imap-send.c b/imap-send.c
index d69887da5a..37ac4aa86a 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -34,8 +34,16 @@ typedef void *SSL;
#include "http.h"
#endif
+#if defined(USE_CURL_FOR_IMAP_SEND) && defined(NO_OPENSSL)
+/* only available option */
+#define USE_CURL_DEFAULT 1
+#else
+/* strictly opt in */
+#define USE_CURL_DEFAULT 0
+#endif
+
static int verbosity;
-static int use_curl; /* strictly opt in */
+static int use_curl = USE_CURL_DEFAULT;
static const char * const imap_send_usage[] = { "git imap-send [-v] [-q] [--[no-]curl] < <mbox>", NULL };
@@ -1504,9 +1512,14 @@ int main(int argc, char **argv)
#ifndef USE_CURL_FOR_IMAP_SEND
if (use_curl) {
- warning("--use-curl not supported in this build");
+ warning("--curl not supported in this build");
use_curl = 0;
}
+#elif defined(NO_OPENSSL)
+ if (!use_curl) {
+ warning("--no-curl not supported in this build");
+ use_curl = 1;
+ }
#endif
if (!server.port)