1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-01-31 07:10:14 -05:00

Use buffered output streams for all output

POP3 already does this.

This is a more general solution to the problem
addressed in commit 8bfd6ca.
This commit is contained in:
Joe Steele 2014-03-01 17:19:36 -05:00
parent df3eef0052
commit 094318dacb
2 changed files with 5 additions and 8 deletions

View File

@ -2450,7 +2450,7 @@ public class ImapStore extends Store {
mIn = new PeekableInputStream(new BufferedInputStream(mSocket.getInputStream(),
1024));
mParser = new ImapResponseParser(mIn);
mOut = mSocket.getOutputStream();
mOut = new BufferedOutputStream(mSocket.getOutputStream(), 1024);
capabilities.clear();
ImapResponse nullResponse = mParser.readResponse();
@ -2488,7 +2488,7 @@ public class ImapStore extends Store {
mIn = new PeekableInputStream(new BufferedInputStream(mSocket
.getInputStream(), 1024));
mParser = new ImapResponseParser(mIn);
mOut = mSocket.getOutputStream();
mOut = new BufferedOutputStream(mSocket.getOutputStream(), 1024);
// Per RFC 2595 (3.1): Once TLS has been started, reissue CAPABILITY command
if (K9.DEBUG)
Log.i(K9.LOG_TAG, "Updating capabilities after STARTTLS for " + getLogId());
@ -2511,8 +2511,6 @@ public class ImapStore extends Store {
}
}
mOut = new BufferedOutputStream(mOut, 1024);
switch (mSettings.getAuthType()) {
case CRAM_MD5:
if (hasCapability(CAPABILITY_AUTH_CRAM_MD5)) {

View File

@ -229,7 +229,7 @@ public class SmtpTransport extends Transport {
mSocket.setSoTimeout(SOCKET_READ_TIMEOUT);
mIn = new PeekableInputStream(new BufferedInputStream(mSocket.getInputStream(), 1024));
mOut = mSocket.getOutputStream();
mOut = new BufferedOutputStream(mSocket.getOutputStream(), 1024);
// Eat the banner
executeSimpleCommand(null);
@ -270,7 +270,7 @@ public class SmtpTransport extends Transport {
mPort, true);
mIn = new PeekableInputStream(new BufferedInputStream(mSocket.getInputStream(),
1024));
mOut = mSocket.getOutputStream();
mOut = new BufferedOutputStream(mSocket.getOutputStream(), 1024);
/*
* Now resend the EHLO. Required by RFC2487 Sec. 5.2, and more specifically,
* Exim.
@ -493,8 +493,7 @@ public class SmtpTransport extends Transport {
executeSimpleCommand("DATA");
EOLConvertingOutputStream msgOut = new EOLConvertingOutputStream(
new LineWrapOutputStream(new SmtpDataStuffing(
new BufferedOutputStream(mOut, 1024)), 1000));
new LineWrapOutputStream(new SmtpDataStuffing(mOut), 1000));
message.writeTo(msgOut);