ソースを参照

发邮件增加超时设置

guohui 1 年間 前
親
コミット
21086d2ff3
共有1 個のファイルを変更した、2 個の追加 と 0 個の削除を含む
  1. 2 0
      pro/src/mail.c

+ 2 - 0
pro/src/mail.c

@@ -204,6 +204,8 @@ static int send_mail(mail_send_t *send, void *addr, char *sub, char *body, char
         curl_easy_setopt(curl, CURLOPT_MIMEPOST, mm);
     }
 
+    r = curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 3L);
+    r = curl_easy_setopt(curl, CURLOPT_TIMEOUT, 5L);
     r = curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
     r = curl_easy_setopt(curl, CURLOPT_MAIL_RCPT, recipients);
     r = curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);