Skip to content

Commit 84a37fa

Browse files
committed
Merge branch 'km/imap-send-libcurl-options' into maint
"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
2 parents 82b6e33 + dcd01ea commit 84a37fa

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

Documentation/git-imap-send.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ OPTIONS
4444

4545
--no-curl::
4646
Talk to the IMAP server using git's own IMAP routines instead of
47-
using libcurl.
47+
using libcurl. Ignored if Git was built with the NO_OPENSSL option
48+
set.
4849

4950

5051
CONFIGURATION

imap-send.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,16 @@ typedef void *SSL;
3434
#include "http.h"
3535
#endif
3636

37+
#if defined(USE_CURL_FOR_IMAP_SEND) && defined(NO_OPENSSL)
38+
/* only available option */
39+
#define USE_CURL_DEFAULT 1
40+
#else
41+
/* strictly opt in */
42+
#define USE_CURL_DEFAULT 0
43+
#endif
44+
3745
static int verbosity;
38-
static int use_curl; /* strictly opt in */
46+
static int use_curl = USE_CURL_DEFAULT;
3947

4048
static const char * const imap_send_usage[] = { "git imap-send [-v] [-q] [--[no-]curl] < <mbox>", NULL };
4149

@@ -1504,9 +1512,14 @@ int main(int argc, char **argv)
15041512

15051513
#ifndef USE_CURL_FOR_IMAP_SEND
15061514
if (use_curl) {
1507-
warning("--use-curl not supported in this build");
1515+
warning("--curl not supported in this build");
15081516
use_curl = 0;
15091517
}
1518+
#elif defined(NO_OPENSSL)
1519+
if (!use_curl) {
1520+
warning("--no-curl not supported in this build");
1521+
use_curl = 1;
1522+
}
15101523
#endif
15111524

15121525
if (!server.port)

0 commit comments

Comments
 (0)