Author: norman
Date: Tue Jan 31 14:18:20 2012
New Revision: 1238594
URL: http://svn.apache.org/viewvc?rev=1238594&view=rev
Log:
Correctly calculate the amount to of bytes to read. I broke this a few days
again while working on some optimization
Modified:
james/server/trunk/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
Modified:
james/server/trunk/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java?rev=1238594&r1=1238593&r2=1238594&view=diff
==============================================================================
---
james/server/trunk/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
(original)
+++
james/server/trunk/protocols-imap4/src/main/java/org/apache/james/imapserver/netty/ImapRequestFrameDecoder.java
Tue Jan 31 14:18:20 2012
@@ -111,9 +111,9 @@ public class ImapRequestFrameDecoder ext
OutputStream out = null;
try {
+ int amount = Math.min(buffer.readableBytes(), size -
written);
out = new FileOutputStream(f, true);
- buffer.readBytes(out, buffer.readableBytes());
-
+ buffer.readBytes(out, amount);
} finally {
IOUtils.closeQuietly(out);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]