From 4bd860a001921e1e007ae448cfdd2c983018c057 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Wed, 26 Nov 2014 22:44:28 +0000 Subject: smtp: Added support for the conversion of Unix newlines during mail send Added support for the automatic conversion of Unix newlines to CRLF during mail uploads. Feature: http://curl.haxx.se/bug/view.cgi?id=1456 --- lib/transfer.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lib/transfer.c') diff --git a/lib/transfer.c b/lib/transfer.c index b48dfce84..2324f2bdd 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -903,15 +903,6 @@ static CURLcode readwrite_upload(struct SessionHandle *data, /* store number of bytes available for upload */ data->req.upload_present = nread; -#ifndef CURL_DISABLE_SMTP - if(conn->handler->protocol & PROTO_FAMILY_SMTP) { - result = Curl_smtp_escape_eob(conn, nread); - if(result) - return result; - } - else -#endif /* CURL_DISABLE_SMTP */ - /* convert LF to CRLF if so asked */ if((!sending_http_headers) && ( #ifdef CURL_DO_LINEEND_CONV @@ -962,6 +953,14 @@ static CURLcode readwrite_upload(struct SessionHandle *data, that instead of reading more data */ } +#ifndef CURL_DISABLE_SMTP + if(conn->handler->protocol & PROTO_FAMILY_SMTP) { + result = Curl_smtp_escape_eob(conn, nread); + if(result) + return result; + } +#endif /* CURL_DISABLE_SMTP */ + /* write to socket (send away data) */ result = Curl_write(conn, conn->writesockfd, /* socket to send to */ -- cgit v1.2.3