cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 OutputBuffer.java

2005-02-27 Thread keith
keith   2005/02/27 13:33:48

  Modified:catalina/src/share/org/apache/coyote/tomcat5 Tag: TOMCAT_5_0
OutputBuffer.java
  Log:
  Backport to 50 branch of fix to allow servlets to return
  multi-gb content-length headers
  
  - allow servlets to set content-length > Integer.MAX_VALUE via setHeader()
  - if servlet sets a content length in this manner, getContentLength will
return -1 if cl > Integer.MAX_VALUE, so test getContentLengthLong to see
if the cl was set.
  
  Revision  ChangesPath
  No   revision
  No   revision
  1.8.2.2   +1 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/Attic/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/Attic/OutputBuffer.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- OutputBuffer.java 18 Nov 2004 22:14:24 -  1.8.2.1
  +++ OutputBuffer.java 27 Feb 2005 21:33:48 -  1.8.2.2
  @@ -267,7 +267,7 @@
   return;
   
   if ((!coyoteResponse.isCommitted()) 
  -&& (coyoteResponse.getContentLength() == -1)) {
  +&& (coyoteResponse.getContentLengthLong() == -1)) {
   // Flushing the char buffer
   if (state == CHAR_STATE) {
   cb.flushBuffer();
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 OutputBuffer.java

2004-01-08 Thread remm
remm2004/01/08 05:09:04

  Modified:catalina/src/share/org/apache/coyote/tomcat5
OutputBuffer.java
  Log:
  - Throw a wrapped IOE when an exception occurs during a low level flush.
  
  Revision  ChangesPath
  1.7   +6 -0  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- OutputBuffer.java 12 Sep 2003 13:16:41 -  1.6
  +++ OutputBuffer.java 8 Jan 2004 13:09:04 -   1.7
  @@ -368,6 +368,12 @@
   if (realFlush) {
   coyoteResponse.action(ActionCode.ACTION_CLIENT_FLUSH, 
 coyoteResponse);
  +// If some exception occurred earlier, or if some IOE occurred
  +// here, notify the servlet with an IOE
  +if (coyoteResponse.isExceptionPresent()) {
  +throw new ClientAbortException
  +(coyoteResponse.getErrorException());
  +}
   }
   
   }
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 OutputBuffer.java

2003-09-12 Thread remm
remm2003/09/12 06:16:41

  Modified:catalina/src/share/org/apache/coyote/tomcat5
OutputBuffer.java
  Log:
  - When flush is called, call the appropriate action to do a lower level flush.
  - Don't flush at the end of request processing.
  
  Revision  ChangesPath
  1.6   +18 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- OutputBuffer.java 2 Sep 2003 21:21:59 -   1.5
  +++ OutputBuffer.java 12 Sep 2003 13:16:41 -  1.6
  @@ -68,6 +68,7 @@
   import java.util.HashMap;
   
   import org.apache.catalina.connector.ClientAbortException;
  +import org.apache.coyote.ActionCode;
   import org.apache.coyote.Response;
   import org.apache.tomcat.util.buf.ByteChunk;
   import org.apache.tomcat.util.buf.C2BConverter;
  @@ -321,7 +322,7 @@
   }
   }
   
  -flush();
  +doFlush(false);
   closed = true;
   
   coyoteResponse.finish();
  @@ -336,6 +337,17 @@
*/
   public void flush()
   throws IOException {
  +doFlush(true);
  +}
  +
  +
  +/**
  + * Flush bytes or chars contained in the buffer.
  + * 
  + * @throws IOException An underlying IOException occurred
  + */
  +protected void doFlush(boolean realFlush)
  +throws IOException {
   
   if (suspended)
   return;
  @@ -352,6 +364,11 @@
   coyoteResponse.sendHeaders();
   }
   doFlush = false;
  +
  +if (realFlush) {
  +coyoteResponse.action(ActionCode.ACTION_CLIENT_FLUSH, 
  +  coyoteResponse);
  +}
   
   }
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 OutputBuffer.java

2003-08-16 Thread remm
remm2003/08/16 06:40:51

  Modified:catalina/src/share/org/apache/coyote/tomcat5
OutputBuffer.java
  Log:
  - Fix client abort logging.
  - Throw a client abort when an IOException occurs when writing bytes.
  
  Revision  ChangesPath
  1.4   +10 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- OutputBuffer.java 30 May 2003 17:00:29 -  1.3
  +++ OutputBuffer.java 16 Aug 2003 13:40:51 -  1.4
  @@ -75,6 +75,8 @@
   
   import org.apache.coyote.Response;
   
  +import org.apache.catalina.connector.ClientAbortException;
  +
   
   /**
* The buffer used by Tomcat response. This is a derivative of the Tomcat 3.3
  @@ -386,7 +388,14 @@
   if (cnt > 0) {
   // real write to the adapter
   outputChunk.setBytes(buf, off, cnt);
  -coyoteResponse.doWrite(outputChunk);
  +try {
  +coyoteResponse.doWrite(outputChunk);
  +} catch (IOException e) {
  +// An IOException on a write is almost always due to
  +// the remote client aborting the request.  Wrap this
  +// so that it can be handled better by the error dispatcher.
  +throw new ClientAbortException(e);
  +}
   }
   
   }
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 OutputBuffer.java

2003-05-31 Thread remm
remm2003/05/30 10:00:29

  Modified:catalina/src/share/org/apache/coyote/tomcat5
OutputBuffer.java
  Log:
  - Commit the response even if the buffer is empty.
  
  Revision  ChangesPath
  1.3   +4 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/OutputBuffer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- OutputBuffer.java 1 May 2003 15:02:46 -   1.2
  +++ OutputBuffer.java 30 May 2003 17:00:29 -  1.3
  @@ -349,8 +349,10 @@
   state = BYTE_STATE;
   } else if (state == BYTE_STATE) {
   bb.flushBuffer();
  -} else if (state == INITIAL_STATE)
  -realWriteBytes(null, 0, 0);   // nothing written yet
  +} else if (state == INITIAL_STATE) {
  +// If the buffers are empty, commit the response header
  +coyoteResponse.sendHeaders();
  +}
   doFlush = false;
   
   }
  
  
  

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