[PATCH 4/4] imap-send: use curl by default

Subsystems: the rest

STALE3280d

5 messages, 3 authors, 2017-08-07 · open the first message on its own page

[PATCH 4/4] imap-send: use curl by default

From: Nicolas Morey-Chaisemartin <hidden>
Date: 2017-08-07 14:23:38

Signed-off-by: Nicolas Morey-Chaisemartin <redacted>
---
 imap-send.c | 6 ------
 1 file changed, 6 deletions(-)
diff --git a/imap-send.c b/imap-send.c
index 90b8683ed..4ebc16437 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -35,13 +35,7 @@ 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 = USE_CURL_DEFAULT;
-- 
2.14.0.rc1.16.g87fcec1e8

Re: [PATCH 4/4] imap-send: use curl by default

From: Martin Ågren <hidden>
Date: 2017-08-07 16:37:30

On 7 August 2017 at 16:04, Nicolas Morey-Chaisemartin
[off-list ref] wrote:
quoted hunk
Signed-off-by: Nicolas Morey-Chaisemartin <redacted>
---
 imap-send.c | 6 ------
 1 file changed, 6 deletions(-)
diff --git a/imap-send.c b/imap-send.c
index 90b8683ed..4ebc16437 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -35,13 +35,7 @@ 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 = USE_CURL_DEFAULT;
So this is now basically "static int use_curl = 1;".

Do we need a compile-time escape-hatch in case someone really needs
to avoid curl, e.g., because they have a too old version? I suppose
there is a conceptual difference between the "default", i.e., the value
of USE_CURL_DEFAULT that is assigned to "use_curl", and the "default
default", i.e., the value that is normally assigned to USE_CURL_DEFAULT.

Martin

Re: [PATCH 4/4] imap-send: use curl by default

From: Nicolas Morey-Chaisemartin <hidden>
Date: 2017-08-07 17:10:56


Le 07/08/2017 à 18:37, Martin Ågren a écrit :
On 7 August 2017 at 16:04, Nicolas Morey-Chaisemartin
[off-list ref] wrote:
quoted
Signed-off-by: Nicolas Morey-Chaisemartin <redacted>
---
 imap-send.c | 6 ------
 1 file changed, 6 deletions(-)
diff --git a/imap-send.c b/imap-send.c
index 90b8683ed..4ebc16437 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -35,13 +35,7 @@ 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 = USE_CURL_DEFAULT;
So this is now basically "static int use_curl = 1;".

Do we need a compile-time escape-hatch in case someone really needs
to avoid curl, e.g., because they have a too old version? I suppose
there is a conceptual difference between the "default", i.e., the value
of USE_CURL_DEFAULT that is assigned to "use_curl", and the "default
default", i.e., the value that is normally assigned to USE_CURL_DEFAULT.

Martin
The curl code depends on USE_CURL_FOR_IMAP_SEND so even with use_curl == 1, it won't be an issue for people without curl (or old one).
I wasn't sure whether to drop the define or not and figure it might be worth keeping in case in change in the future for some reason.
I don't mind dropping it and hardcofing the default to 1

Also on a side note, I have a case where authentication works with --no-curl but fails withs --curl. Still trying to figure out why.

Nicolas

Re: [PATCH 4/4] imap-send: use curl by default

From: Martin Ågren <hidden>
Date: 2017-08-07 17:37:47

On 7 August 2017 at 19:10, Nicolas Morey-Chaisemartin
[off-list ref] wrote:

Le 07/08/2017 à 18:37, Martin Ågren a écrit :
quoted
On 7 August 2017 at 16:04, Nicolas Morey-Chaisemartin
[off-list ref] wrote:
quoted
Signed-off-by: Nicolas Morey-Chaisemartin <redacted>
---
 imap-send.c | 6 ------
 1 file changed, 6 deletions(-)
diff --git a/imap-send.c b/imap-send.c
index 90b8683ed..4ebc16437 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -35,13 +35,7 @@ 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 = USE_CURL_DEFAULT;
So this is now basically "static int use_curl = 1;".

Do we need a compile-time escape-hatch in case someone really needs
to avoid curl, e.g., because they have a too old version? I suppose
there is a conceptual difference between the "default", i.e., the value
of USE_CURL_DEFAULT that is assigned to "use_curl", and the "default
default", i.e., the value that is normally assigned to USE_CURL_DEFAULT.

Martin
The curl code depends on USE_CURL_FOR_IMAP_SEND so even with use_curl == 1, it won't be an issue for people without curl (or old one).
I have just looked at the sources and haven't thought too hard about it,
but doesn't it mean that compiling without USE_CURL_FOR_IMAP_SEND
results in a binary such that you must use --no-curl or get used to seeing
"warning: --curl not supported in this build"?
I wasn't sure whether to drop the define or not and figure it might be worth keeping in case in change in the future for some reason.
I don't mind dropping it and hardcofing the default to 1
I did not intend to suggest that. Just to be clear, I am very unfamiliar
with most of the Git codebase. Please don't take anything I say as
advice. :) As a question about something you have or haven't already
thought about, sure. :)

Martin

Re: [PATCH 4/4] imap-send: use curl by default

From: Jeff King <hidden>
Date: 2017-08-07 20:01:37

On Mon, Aug 07, 2017 at 04:04:05PM +0200, Nicolas Morey-Chaisemartin wrote:
Signed-off-by: Nicolas Morey-Chaisemartin <redacted>
Thanks for moving forward with this.

Can you please flesh out your commit messages with some of the reasoning
and related discussion? I know from a nearby thread why we want to flip
the default, but people reading `git log` much later will not have that
context.
quoted hunk
diff --git a/imap-send.c b/imap-send.c
index 90b8683ed..4ebc16437 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -35,13 +35,7 @@ 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
I agree with the comments Martin made here. I think there are really two
levels of "default" we need to care about:

  1. Build-time: do we default to requiring curl if you want imap-send
     at all?

  2. Run-time: if build with both implementations, which do we use by
     default? Related, if there is only one implementation, what should
     the default be?

I think the answer to (1) is that we still want to build imap-send
without USE_CURL_FOR_IMAP_SEND if the user doesn't have curl installed.
And your patch leaves that, which is good. Though if we are deprecating
it, we may want to issue a deprecation warning (eventually; we can still
switch the run-time default now, get more data on whether a
deprecation/switch is a good idea, and then later decide to deprecate).

For (2), you're trying to switch the default when both are built. But I
think it's important to continue to default to the old-style
implementation if that's the only thing that was built. Otherwise it
effectively becomes the build-time deprecation warning, and we're not
quite ready for that.

So I think this maybe needs to be:

  #if defined(USE_CURL_FOR_IMAP_SEND)
  /* Always default to curl if it's available. */
  #define USE_CURL_DEFAULT 1
  #else
  /* We don't have curl, so continue to use the historical implementation */
  #define USE_CURL_DEFAULT 0
  #endif

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help