You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/07/27 05:22:57 UTC
cvs commit: ws-axis/java/src/org/apache/axis/attachments ManagedMemoryDataSource.java
dims 2005/07/26 20:22:57
Modified: java/src/org/apache/axis/attachments
ManagedMemoryDataSource.java
Log:
Fix for AXIS-2134 - ManagedMemoryDataSource does not correctly handle large attachments
from Rodrigo Ruiz
Revision Changes Path
1.37 +3 -3 ws-axis/java/src/org/apache/axis/attachments/ManagedMemoryDataSource.java
Index: ManagedMemoryDataSource.java
===================================================================
RCS file: /home/cvs/ws-axis/java/src/org/apache/axis/attachments/ManagedMemoryDataSource.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- ManagedMemoryDataSource.java 1 Nov 2004 14:25:31 -0000 1.36
+++ ManagedMemoryDataSource.java 27 Jul 2005 03:22:57 -0000 1.37
@@ -487,7 +487,7 @@
private class Instream extends java.io.InputStream {
/** bytes read. */
- protected int bread = 0;
+ protected long bread = 0;
/** The real stream. */
java.io.FileInputStream fin = null;
@@ -540,8 +540,8 @@
throw new java.io.IOException(
Messages.getMessage("streamClosed"));
}
- // Will return neg. value when totalsz > 2Gb
- int ret = new Long(totalsz - bread).intValue();
+
+ int ret = new Long(Math.min(Integer.MAX_VALUE, totalsz - bread)).intValue();
if (debugEnabled) {
is_log.debug("available() = " + ret + ".");