{"thread":{"id":"37920","subject":"[PATCH] imap-send: avoid curl functions when not building curl support","startedAt":"2014-11-10T06:39:47Z","lastAt":"2014-11-10T07:16:24Z","messageCount":2,"participants":["Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"251652","messageId":"20141110063947.GA7894@peff.net","threadId":"37920","inReplyTo":null,"subject":"[PATCH] imap-send: avoid curl functions when not building curl support","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-11-10T06:39:47Z","receivedAt":"2014-11-10T06:39:47Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"Imap-send recently learned to conditionally compile against\nand use curl for imap support. To use this feature, you must\nboth:\n\n  1. Compile with USE_CURL_FOR_IMAP_SEND\n\n  2. Specify --curl on the command line to enable it\n\nIt is OK (and even desirable) for the code checking --curl\nto be compiled even if USE_CURL_FOR_IMAP_SEND is not in\neffect; this lets us explain the situation to the user\n(instead of saying \"--curl? never heard of it\").\n\nHowever, the code which conditionally runs when --curl is\nenabled must _not_ be compiled in this case. It references\nfunctions which are neither declared nor defined, causing\nthe compiler to complain.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nOn top of br/imap-send-via-libcurl. I needed this to compile 'pu' with\nNO_CURL (which I don't usually do, but was testing on a minimal box). I\nexpect it can just be squashed in to the next re-roll.\n\nSince we were talking about testing in another thread, Junio, I wonder\nif it is worth having you compile your integration results against a\ncouple different configs (e.g., NO_CURL). Obviously that will make\nthings slower if you don't throw more CPU power at it, but that seems\nlike a problem that can be solved with build servers or similar.\n\n imap-send.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/imap-send.c b/imap-send.c\nindex ad4ac22..e0e1f09 100644\n--- a/imap-send.c\n+++ b/imap-send.c\n@@ -1542,8 +1542,10 @@ int main(int argc, char **argv)\n \tif (server.tunnel)\n \t\treturn append_msgs_to_imap(&server, &all_msgs, total);\n \n+#ifdef USE_CURL_FOR_IMAP_SEND\n \tif (use_curl)\n \t\treturn curl_append_msgs_to_imap(&server, &all_msgs, total);\n+#endif\n \n \treturn append_msgs_to_imap(&server, &all_msgs, total);\n }\n-- \n2.1.2.596.g7379948\n"},{"id":"251658","messageId":"20141110071623.GA9063@peff.net","threadId":"37920","inReplyTo":"20141110063947.GA7894@peff.net","subject":"Re: [PATCH] imap-send: avoid curl functions when not building curl support","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-11-10T07:16:24Z","receivedAt":"2014-11-10T07:16:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 10, 2014 at 01:39:47AM -0500, Jeff King wrote:\n\n> On top of br/imap-send-via-libcurl. I needed this to compile 'pu' with\n> NO_CURL (which I don't usually do, but was testing on a minimal box). I\n> expect it can just be squashed in to the next re-roll.\n\nOops, just started reading through my list backlog and realized you\nalready noticed and dealt with this. Sorry for the noise.\n\n-Peff\n"}]}