Author: markt
Date: Wed Jan 11 12:45:57 2006
New Revision: 368125

URL: http://svn.apache.org/viewcvs?rev=368125&view=rev
Log:
Further improvements to patch for bug 29214.

Modified:
    
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java

Modified: 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java?rev=368125&r1=368124&r2=368125&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java
 (original)
+++ 
tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/connector/Response.java
 Wed Jan 11 12:45:57 2006
@@ -219,12 +219,6 @@
     private boolean isCharacterEncodingSet = false;
     
     /**
-     * The contentLength flag
-     */    
-    private boolean isContentLengthSet = false;
-
-    
-    /**
      * The error flag.
      */
     protected boolean error = false;
@@ -275,7 +269,6 @@
         appCommitted = false;
         included = false;
         error = false;
-        isContentLengthSet = false;
         isCharacterEncodingSet = false;
         
         cookies.clear();
@@ -651,7 +644,6 @@
 
         coyoteResponse.reset();
         outputBuffer.reset();
-        isContentLengthSet = false;
     }
 
 
@@ -709,8 +701,6 @@
             return;
         
         coyoteResponse.setContentLength(length);
-        
-        isContentLengthSet = true;
 
     }
 
@@ -1013,12 +1003,6 @@
 
         coyoteResponse.addHeader(name, value);
 
-        char cc=name.charAt(0);
-        if(cc=='C' || cc=='c') {
-            if(name.equalsIgnoreCase("Content-Length")) {
-                isContentLengthSet = true;
-            }
-        }
     }
 
 
@@ -1057,8 +1041,8 @@
                 return (coyoteResponse.getContentType() != null);
             }
             if(name.equalsIgnoreCase("Content-Length")) {
-                // Can't use null test since this header is an int
-                return isContentLengthSet;
+                // -1 means not known and is not sent to client
+                return (coyoteResponse.getContentLengthLong() != -1);
             }
         }
 
@@ -1290,13 +1274,6 @@
             return;
 
         coyoteResponse.setHeader(name, value);
-
-        char cc=name.charAt(0);
-        if(cc=='C' || cc=='c') {
-            if(name.equalsIgnoreCase("Content-Length")) {
-                isContentLengthSet = true;
-            }
-        }
 
     }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to