(SMTP) support DATA better in the server and make sure to "escape" CRLF.CRLF
sequences in uploaded data. The test server doesn't "decode" escaped dot-lines but instead test cases must be written to take them into account. Added test case 803 to verify dot-escaping.
This commit is contained in:
10
lib/smtp.c
10
lib/smtp.c
@@ -639,6 +639,7 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
|
||||
struct SessionHandle *data = conn->data;
|
||||
struct FTP *smtp = data->state.proto.smtp;
|
||||
CURLcode result=CURLE_OK;
|
||||
ssize_t bytes_written;
|
||||
(void)premature;
|
||||
|
||||
if(!smtp)
|
||||
@@ -653,6 +654,15 @@ static CURLcode smtp_done(struct connectdata *conn, CURLcode status,
|
||||
conn->bits.close = TRUE; /* marked for closure */
|
||||
result = status; /* use the already set error code */
|
||||
}
|
||||
else
|
||||
/* TODO: make this work even when the socket is EWOULDBLOCK in this call! */
|
||||
|
||||
/* write to socket (send away data) */
|
||||
result = Curl_write(conn,
|
||||
conn->writesockfd, /* socket to send to */
|
||||
SMTP_EOB, /* buffer pointer */
|
||||
SMTP_EOB_LEN, /* buffer size */
|
||||
&bytes_written); /* actually sent away */
|
||||
|
||||
/* clear these for next connection */
|
||||
smtp->transfer = FTPTRANSFER_BODY;
|
||||
|
||||
Reference in New Issue
Block a user