james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r675781 - /james/mime4j/trunk/src/main/java/org/apache/james/mime4j/MimeBoundaryInputStream.java
Date Thu, 10 Jul 2008 22:08:19 GMT
Author: rdonkin
Date: Thu Jul 10 15:08:19 2008
New Revision: 675781

URL: http://svn.apache.org/viewvc?rev=675781&view=rev
Log:
For some JVMs, Sun elects to throw a IOException when an InputStreamReader encounters a zero.
For example, see http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4684515. This prevents
JAMES IMAP from functioning correct when faced with some large emails. Most clients will simply
call this method again if zero is returned so I think that this fix should reasonably safe
but please review.

Modified:
    james/mime4j/trunk/src/main/java/org/apache/james/mime4j/MimeBoundaryInputStream.java

Modified: james/mime4j/trunk/src/main/java/org/apache/james/mime4j/MimeBoundaryInputStream.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/MimeBoundaryInputStream.java?rev=675781&r1=675780&r2=675781&view=diff
==============================================================================
--- james/mime4j/trunk/src/main/java/org/apache/james/mime4j/MimeBoundaryInputStream.java
(original)
+++ james/mime4j/trunk/src/main/java/org/apache/james/mime4j/MimeBoundaryInputStream.java
Thu Jul 10 15:08:19 2008
@@ -115,7 +115,7 @@
         }
         fillBuffer();
         if (!hasData()) {
-            return 0;
+            return read(b, off, len);
         }
         int chunk = Math.min(len, limit - buffer.pos());
         return buffer.read(b, off, chunk);



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message