1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-23 18:02:15 -05:00

Change our technique for sending \r\n at the end of smtp commands to

deal with a weird failure on honeycomb
This commit is contained in:
Jesse Vincent 2011-02-26 16:53:53 -05:00
parent 9ad258381b
commit c7a3b28289

View File

@ -395,12 +395,7 @@ public class SmtpTransport extends Transport {
* only ASCII characters are allowed in SMTP commands i.e. this string * only ASCII characters are allowed in SMTP commands i.e. this string
* will never contain multi-byte characters. * will never contain multi-byte characters.
*/ */
int len = s.length(); byte[] data = (s.concat("\r\n")).getBytes();
byte[] data = new byte[len + 2];
s.getBytes(0, len, data, 0);
data[len+0] = '\r';
data[len+1] = '\n';
/* /*
* Important: Send command + CRLF using just one write() call. Using * Important: Send command + CRLF using just one write() call. Using
* multiple calls will likely result in multiple TCP packets and some * multiple calls will likely result in multiple TCP packets and some