imap-send: only use CURLOPT_LOGIN_OPTIONS if it is actually available
This fixes the compilation on an older Linux that was used to debug test failures when upgrading Git for Windows to Git v2.3.0. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a2558fb8e1
commit
71d9257525
@ -1422,11 +1422,15 @@ static CURL *setup_curl(struct imap_server_conf *srvc)
|
|||||||
curl_easy_setopt(curl, CURLOPT_PORT, server.port);
|
curl_easy_setopt(curl, CURLOPT_PORT, server.port);
|
||||||
|
|
||||||
if (server.auth_method) {
|
if (server.auth_method) {
|
||||||
|
#if LIBCURL_VERSION_NUM < 0x072200
|
||||||
|
warning("No LOGIN_OPTIONS support in this cURL version");
|
||||||
|
#else
|
||||||
struct strbuf auth = STRBUF_INIT;
|
struct strbuf auth = STRBUF_INIT;
|
||||||
strbuf_addstr(&auth, "AUTH=");
|
strbuf_addstr(&auth, "AUTH=");
|
||||||
strbuf_addstr(&auth, server.auth_method);
|
strbuf_addstr(&auth, server.auth_method);
|
||||||
curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
|
curl_easy_setopt(curl, CURLOPT_LOGIN_OPTIONS, auth.buf);
|
||||||
strbuf_release(&auth);
|
strbuf_release(&auth);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!server.use_ssl)
|
if (!server.use_ssl)
|
||||||
|
Reference in New Issue
Block a user