You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2003/12/10 12:59:18 UTC
cvs commit: ws-axis/java/src/org/apache/axis/attachments ManagedMemoryDataSource.java
dims 2003/12/10 03:59:18
Modified: java/src/org/apache/axis/attachments
ManagedMemoryDataSource.java
Log:
Fix for Bug 25385 - Bug in MemoryManagedDataSource from torstein.olsen@nb.no (Torstein Olsen)
Revision Changes Path
1.31 +9 -7 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.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ManagedMemoryDataSource.java 1 Dec 2003 17:57:32 -0000 1.30
+++ ManagedMemoryDataSource.java 10 Dec 2003 11:59:18 -0000 1.31
@@ -265,7 +265,7 @@
0;
/** The total size in bytes in this data source. */
- protected int totalsz = 0;
+ protected long totalsz = 0;
/** This is the cached disk stream. */
protected java.io.BufferedOutputStream cachediskstream =
@@ -578,8 +578,8 @@
throw new java.io.IOException(
Messages.getMessage("streamClosed"));
}
-
- int ret = totalsz - bread;
+ // Will return neg. value when totalsz > 2Gb
+ int ret = new Long(totalsz - bread).intValue();
if (debugEnabled) {
is_log.debug("available() = " + ret + ".");
@@ -763,12 +763,14 @@
}
java.util.List ml = memorybuflist;
-
- len = Math.min(
- len,
+
+ long longlen = len;
+ longlen = Math.min(
+ longlen,
totalsz
- bread); // Only return the number of bytes in the data store that is left.
-
+ len = new Long(longlen).intValue();
+
if (debugEnabled) {
is_log.debug("len = " + len);
}