remm        2003/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  Changes    Path
  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 -0000      1.3
  +++ OutputBuffer.java 16 Aug 2003 13:40:51 -0000      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]

Reply via email to