cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r179249 - /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java /cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/BufferedOutputStream.java /cocoon/branches/BRANCH_2_1_X/status.xml
Date Tue, 31 May 2005 18:01:03 GMT
Author: cziegeler
Date: Tue May 31 11:01:03 2005
New Revision: 179249

URL: http://svn.apache.org/viewcvs?rev=179249&view=rev
Log:
Set the content-length of a response when the pipeline buffers the content
(which is the default).

Modified:
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
    cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/BufferedOutputStream.java
    cocoon/branches/BRANCH_2_1_X/status.xml

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java?rev=179249&r1=179248&r2=179249&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/environment/AbstractEnvironment.java
Tue May 31 11:01:03 2005
@@ -56,22 +56,22 @@
     protected StringBuffer prefix = new StringBuffer();
 
     /** The View requested */
-    protected String view = null;
+    protected String view;
 
     /** The Action requested */
-    protected String action = null;
+    protected String action;
 
      /** The Context path */
-    protected String context = null;
+    protected String context;
 
     /** The context path stored temporarily between constructor and initComponents */
-    private String tempInitContext = null;
+    private String tempInitContext;
 
     /** The root context path */
-    protected String rootContext = null;
+    protected String rootContext;
 
     /** The servlet object model */
-    protected HashMap objectModel = null;
+    protected HashMap objectModel;
 
     /** The real source resolver */
     protected org.apache.excalibur.source.SourceResolver sourceResolver;
@@ -518,6 +518,7 @@
     public void commitResponse()
     throws IOException {
         if (this.secureOutputStream != null) {
+            this.setContentLength(this.secureOutputStream.getCount());
             this.secureOutputStream.realFlush();
         } else if (this.outputStream != null) {
             this.outputStream.flush();

Modified: cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/BufferedOutputStream.java
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/BufferedOutputStream.java?rev=179249&r1=179248&r2=179249&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/BufferedOutputStream.java
(original)
+++ cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/util/BufferedOutputStream.java
Tue May 31 11:01:03 2005
@@ -101,11 +101,12 @@
 
     /**
      * Flushes this buffered output stream. 
-     * We don't flush here. 
+     * We don't flush here, flushing is done during closing.
      *
      * @exception  IOException  if an I/O error occurs.
      */
     public void flush() throws IOException {
+        // nothing
     }
 
     /**
@@ -121,7 +122,6 @@
 
     /**
      * Flushes this buffered output stream. 
-     * We don't flush here. 
      */
     public void realFlush() throws IOException {
         this.writeBuffer();
@@ -135,6 +135,7 @@
     throws IOException {
         if (this.count > 0) {
             this.out.write(this.buf, 0, this.count);
+            this.clearBuffer();
         }
     }
 
@@ -156,5 +157,11 @@
         this.count = 0;
     }
     
+    /**
+     * Return the size of the current buffer
+     */
+    public int getCount() {
+        return this.count;
+    }
 }
 

Modified: cocoon/branches/BRANCH_2_1_X/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/status.xml?rev=179249&r1=179248&r2=179249&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/status.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/status.xml Tue May 31 11:01:03 2005
@@ -196,6 +196,10 @@
 
   <changes>
   <release version="@version@" date="@date@">
+    <action dev="CZ" type="update">
+      Set the content-length of a response when the pipeline buffers the content
+      (which is the default).
+    </action>
     <action dev="AN" type="fix" fixes-bug="32935">
       XSP Block: Double check and attempt again to load program object from cache.
       This avoids that simultaneous requests recompile the same XSP over and over again.



Mime
View raw message