tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@apache.org
Subject svn commit: r575478 - in /tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector: OutputBuffer.java Response.java
Date Thu, 13 Sep 2007 21:56:30 GMT
Author: pero
Date: Thu Sep 13 14:56:30 2007
New Revision: 575478

URL: http://svn.apache.org/viewvc?rev=575478&view=rev
Log:
Improve large-file support (more then 4 Gb) at all AccessLogValves, backport from 5.5.25.

Modified:
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java
    tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java?rev=575478&r1=575477&r2=575478&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/OutputBuffer.java Thu Sep 13 14:56:30
2007
@@ -70,13 +70,13 @@
     /**
      * Number of bytes written.
      */
-    private int bytesWritten = 0;
+    private long bytesWritten = 0;
 
 
     /**
      * Number of chars written.
      */
-    private int charsWritten = 0;
+    private long charsWritten = 0;
 
 
     /**
@@ -539,22 +539,32 @@
 
     }
 
-
     public int getBytesWritten() {
-        return bytesWritten;
+        if (bytesWritten < Integer.MAX_VALUE) {
+            return (int) bytesWritten;
+        }
+        return -1;
     }
 
-
     public int getCharsWritten() {
-        return charsWritten;
+        if (charsWritten < Integer.MAX_VALUE) {
+            return (int) charsWritten;
+        }
+        return -1;
     }
 
-
     public int getContentWritten() {
-        return bytesWritten + charsWritten;
+        long size = bytesWritten + charsWritten ;
+        if (size < Integer.MAX_VALUE) {
+            return (int) size;
+        }
+        return -1;
     }
 
-
+    public long getContentWrittenLong() {
+        return bytesWritten + charsWritten;
+    }
+    
     /** 
      * True if this buffer hasn't been used ( since recycle() ) -
      * i.e. no chars or bytes have been added to the buffer.  

Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java?rev=575478&r1=575477&r2=575478&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/connector/Response.java Thu Sep 13 14:56:30
2007
@@ -305,7 +305,13 @@
     public int getContentCount() {
         return outputBuffer.getContentWritten();
     }
-
+    
+    /**
+     * Return the number of bytes actually written to the output stream.
+     */
+    public long getContentCountLong() {
+        return outputBuffer.getContentWrittenLong();
+    }
 
     /**
      * Set the application commit flag.



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


Mime
View raw message