diff options
author | Daniel Stenberg <daniel@haxx.se> | 2009-12-30 21:52:27 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2009-12-30 21:52:27 +0000 |
commit | 5e6ffe353ab478d67c2964de5a3eb2fd9fcb0528 (patch) | |
tree | 549b29be4a73756bdf19e8a4f0dbb67be4a965c0 /lib/smtp.c | |
parent | d7cd761047376576d281bbc2dc40c02afa251912 (diff) |
(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.
Diffstat (limited to 'lib/smtp.c')
-rw-r--r-- | lib/smtp.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/smtp.c b/lib/smtp.c index 1bd869eb0..3dc50bd6a 100644 --- a/lib/smtp.c +++ b/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; |