Merge branch 'km/imap-send-libcurl-options'
authorJunio C Hamano <gitster@pobox.com>
Wed, 14 Jan 2015 20:31:50 +0000 (12:31 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Jan 2015 20:31:50 +0000 (12:31 -0800)
Now imap-send learned to talk to the server using cURL library,
allow the same GIT_CURL_VERBOSE environment variable to control the
verbosity of the chattering.

* km/imap-send-libcurl-options:
imap-send.c: set CURLOPT_USE_SSL to CURLUSESSL_TRY
imap-send.c: support GIT_CURL_VERBOSE

imap-send.c
index 4dfe4c25d76649e982858c69e6bc7ff1ec32f645..d69887da5a8530b204a5f5baf7081787224fc3bd 100644 (file)
@@ -1421,8 +1421,8 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
                strbuf_release(&auth);
        }
 
-       if (server.use_ssl)
-               curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
+       if (!server.use_ssl)
+               curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_TRY);
 
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, server.ssl_verify);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, server.ssl_verify);
@@ -1431,7 +1431,7 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
 
        curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
 
-       if (0 < verbosity)
+       if (0 < verbosity || getenv("GIT_CURL_VERBOSE"))
                curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
 
        return curl;