From 687aabd30b3433c70ef698dc967f54da3d844779 Mon Sep 17 00:00:00 2001 From: Yu Zhao Date: Fri, 25 Apr 2014 09:27:34 -0700 Subject: [PATCH] plugins/alarm_curl: turn on SMTP protocol Compiler ignores SMTP support because enums CURLOPT_MAIL_RCPT and CURLPROTO_SMTP are misused as macros for conditional compilation. Replace the enums with real macro CURLPROTO_SMTP so compiler can detect them. --- plugins/alarm_curl/alarm_curl_plugin.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/alarm_curl/alarm_curl_plugin.c b/plugins/alarm_curl/alarm_curl_plugin.c index bd04d49d..ca436ba0 100644 --- a/plugins/alarm_curl/alarm_curl_plugin.c +++ b/plugins/alarm_curl/alarm_curl_plugin.c @@ -17,7 +17,7 @@ struct uwsgi_alarm_curl_opt { }; -#ifdef CURLOPT_MAIL_RCPT +#ifdef CURLPROTO_SMTP static void uwsgi_alarm_curl_to(CURL *curl, CURLoption option, char *arg, struct uwsgi_alarm_curl_config *uacc) { uacc->to = arg; struct curl_slist *list = NULL; @@ -46,10 +46,8 @@ static void uwsgi_alarm_curl_set_subject(CURL *curl, CURLoption option, char *ar static struct uwsgi_alarm_curl_opt uaco[] = { {"url", CURLOPT_URL, NULL}, -#ifdef CURLOPT_MAIL_RCPT - {"mail_to", CURLOPT_MAIL_RCPT, uwsgi_alarm_curl_to }, -#endif -#ifdef CURLOPT_MAIL_FROM +#ifdef CURLPROTO_SMTP + {"mail_to", CURLOPT_MAIL_RCPT, uwsgi_alarm_curl_to}, {"mail_from", CURLOPT_MAIL_FROM, NULL}, #endif {"subject", 0, uwsgi_alarm_curl_set_subject},