From c344932bbd163c18c91f5abc42158e7fa2f89d49 Mon Sep 17 00:00:00 2001 From: Pavel Volgarev Date: Tue, 14 Jan 2020 17:52:10 -0500 Subject: [PATCH] Multiple 'RCPT TO': Added some comments to the code. --- lib/setopt.c | 10 +++++----- lib/smtp.c | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/setopt.c b/lib/setopt.c index d863d8a25f9e36..a48ebc1c19cf34 100644 --- a/lib/setopt.c +++ b/lib/setopt.c @@ -2485,13 +2485,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param) * for generic server options, the application will need to set this. */ result = Curl_setstropt(&data->set.str[STRING_RTSP_STREAM_URI], - recipientsar *)); - brerecipients + va_arg(param, char *)); + break; - case recipients + case CURLOPT_RTSP_TRANSPORT: /* - * recipientsfor the RTSP request - */recipients + * The content of the Transport: header for the RTSP request + */ result = Curl_setstropt(&data->set.str[STRING_RTSP_TRANSPORT], va_arg(param, char *)); break; diff --git a/lib/smtp.c b/lib/smtp.c index bf655480511f33..0f9a597c8c29d6 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -919,10 +919,15 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode, (void)instate; /* no use for this yet */ bool is_smtp_err = smtpcode/100 != 2; + + /* If there's multiple "RCPT TO" to be issued, it's possible to ignore errors + and proceed with only the valid addresses. */ bool is_smtp_blocking_err = is_smtp_err && !data->set.mail_rcpt_ignore_invalid; if (is_smtp_err) { + /* Remembering the last failure which we can report if all "RCPT TO" have + failed and we cannot proceed. */ smtp->rcpt_last_error = smtpcode; if (is_smtp_blocking_err) { @@ -930,6 +935,7 @@ static CURLcode smtp_state_rcpt_resp(struct connectdata *conn, int smtpcode, result = CURLE_SEND_ERROR; } } else { + /* Some "RCPT TO" have succeeded. */ smtp->rcpt_had_ok = TRUE; }