tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@locus.apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets DefaultServlet.java
Date Thu, 09 Nov 2000 18:56:15 GMT
remm        00/11/09 10:56:10

  Modified:    catalina/src/share/org/apache/catalina/servlets
                        DefaultServlet.java
  Log:
  - Revert yesterday's change, which is now unnecessary due the change in
    chunking policy.
  
  Revision  Changes    Path
  1.13      +23 -51    jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java
  
  Index: DefaultServlet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DefaultServlet.java	2000/11/09 07:22:22	1.12
  +++ DefaultServlet.java	2000/11/09 18:56:10	1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.12 2000/11/09 07:22:22 remm Exp $
  - * $Revision: 1.12 $
  - * $Date: 2000/11/09 07:22:22 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/servlets/DefaultServlet.java,v
1.13 2000/11/09 18:56:10 remm Exp $
  + * $Revision: 1.13 $
  + * $Date: 2000/11/09 18:56:10 $
    *
    * ====================================================================
    *
  @@ -112,7 +112,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.12 $ $Date: 2000/11/09 07:22:22 $
  + * @version $Revision: 1.13 $ $Date: 2000/11/09 18:56:10 $
    */
   
   public class DefaultServlet
  @@ -1316,6 +1316,25 @@
           ServletOutputStream ostream = null;
           PrintWriter writer = null;
           
  +        if (content) {
  +
  +            // Trying to retrieve the servlet output stream
  +            
  +            try {
  +                ostream = response.getOutputStream();
  +            } catch (IllegalStateException e) {
  +                // If it fails, we try to get a Writer instead if we're 
  +                // trying to serve a text file
  +                if ( (contentType != null) 
  +                     && (contentType.startsWith("text")) ) {
  +                    writer = response.getWriter();
  +                } else {
  +                    throw e;
  +                }
  +            }
  +
  +        }
  +        
           if ( ((ranges == null) || (ranges.isEmpty())) 
                && (request.getHeader("Range") == null) ) {
               
  @@ -1334,21 +1353,6 @@
                   response.setContentLength((int) contentLength);
               }
               
  -            // Trying to retrieve the servlet output stream
  -            
  -            try {
  -                ostream = response.getOutputStream();
  -            } catch (IllegalStateException e) {
  -                // If it fails, we try to get a Writer instead if we're 
  -                // trying to serve a text file
  -                if ( (contentType != null) 
  -                     && (contentType.startsWith("text")) ) {
  -                    writer = response.getWriter();
  -                } else {
  -                    throw e;
  -                }
  -            }
  -
               // Copy the input stream to our output stream (if requested)
               if (content) {
                   response.setBufferSize(output);
  @@ -1385,22 +1389,6 @@
                   
                   if (content) {
                       response.setBufferSize(output);
  -
  -                    // Trying to retrieve the servlet output stream
  -                    
  -                    try {
  -                        ostream = response.getOutputStream();
  -                    } catch (IllegalStateException e) {
  -                        // If it fails, we try to get a Writer instead if 
  -                        // we're trying to serve a text file
  -                        if ( (contentType != null) 
  -                             && (contentType.startsWith("text")) ) {
  -                            writer = response.getWriter();
  -                        } else {
  -                            throw e;
  -                        }
  -                    }
  -                    
                       if (ostream != null) {
                           copy(resourceInfo, ostream, range);
                       } else {
  @@ -1415,22 +1403,6 @@
                   
                   if (content) {
                       response.setBufferSize(output);
  -                    
  -                    // Trying to retrieve the servlet output stream
  -                    
  -                    try {
  -                        ostream = response.getOutputStream();
  -                    } catch (IllegalStateException e) {
  -                        // If it fails, we try to get a Writer instead if 
  -                        // we're trying to serve a text file
  -                        if ( (contentType != null) 
  -                             && (contentType.startsWith("text")) ) {
  -                            writer = response.getWriter();
  -                        } else {
  -                            throw e;
  -                        }
  -                    }
  -                    
                       if (ostream != null) {
                           copy(resourceInfo, ostream, ranges.elements(), 
                                contentType);
  
  
  

Mime
View raw message