tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 InternalAprOutputBuffer.java Http11AprProcessor.java
Date Thu, 04 Aug 2005 07:07:57 GMT
remm        2005/08/04 00:07:57

  Modified:    jk/java/org/apache/coyote/ajp AjpAprProcessor.java
               http11/src/java/org/apache/coyote/http11
                        InternalAprOutputBuffer.java
                        Http11AprProcessor.java
  Log:
  - Remove useless HTTP/1.1 PAs (which seem to be only there for initial
    access to the util package).
  - Fix AJP APR when security is enabled (access to the util package was failing).
  
  Revision  Changes    Path
  1.17      +7 -4      jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java
  
  Index: AjpAprProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/coyote/ajp/AjpAprProcessor.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AjpAprProcessor.java	30 Jul 2005 22:22:57 -0000	1.16
  +++ AjpAprProcessor.java	4 Aug 2005 07:07:57 -0000	1.17
  @@ -92,14 +92,17 @@
               readTimeout = 100 * 1000;
           }
   
  -        // Cause loading of HexUtils
  -        int foo = HexUtils.DEC[0];
  -
           // Allocate input and output buffers
           inputBuffer = ByteBuffer.allocateDirect(16 * 1024);
           inputBuffer.limit(0);
           outputBuffer = ByteBuffer.allocateDirect(16 * 1024);
   
  +        // Cause loading of HexUtils
  +        int foo = HexUtils.DEC[0];
  +
  +        // Cause loading of HttpMessages
  +        HttpMessages.getMessage(200);
  +
       }
   
   
  @@ -886,7 +889,7 @@
           responseHeaderMessage.appendInt(response.getStatus());
           String message = response.getMessage();
           if (message == null){
  -            message= HttpMessages.getMessage(response.getStatus());
  +            message = HttpMessages.getMessage(response.getStatus());
           } else {
               message = message.replace('\n', ' ').replace('\r', ' ');
           }
  
  
  
  1.5       +6 -30     jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
  
  Index: InternalAprOutputBuffer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/InternalAprOutputBuffer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InternalAprOutputBuffer.java	18 May 2005 09:25:08 -0000	1.4
  +++ InternalAprOutputBuffer.java	4 Aug 2005 07:07:57 -0000	1.5
  @@ -18,8 +18,6 @@
   
   import java.io.IOException;
   import java.nio.ByteBuffer;
  -import java.security.AccessController;
  -import java.security.PrivilegedAction;
   
   import org.apache.tomcat.jni.Socket;
   import org.apache.tomcat.util.buf.ByteChunk;
  @@ -78,6 +76,9 @@
           committed = false;
           finished = false;
   
  +        // Cause loading of HttpMessages
  +        HttpMessages.getMessage(200);
  +
       }
   
   
  @@ -428,42 +429,17 @@
           // Write message
           String message = response.getMessage();
           if (message == null) {
  -            write(getMessage(status));
  +            write(HttpMessages.getMessage(status));
           } else {
               write(message);
           }
   
           // End the response status line
  -        if (System.getSecurityManager() != null){
  -           AccessController.doPrivileged(
  -                new PrivilegedAction(){
  -                    public Object run(){
  -                        buf[pos++] = Constants.CR;
  -                        buf[pos++] = Constants.LF;
  -                        return null;
  -                    }
  -                }
  -           );
  -        } else {
  -            buf[pos++] = Constants.CR;
  -            buf[pos++] = Constants.LF;
  -        }
  +        buf[pos++] = Constants.CR;
  +        buf[pos++] = Constants.LF;
   
       }
   
  -    private String getMessage(final int message){
  -        if (System.getSecurityManager() != null){
  -           return (String)AccessController.doPrivileged(
  -                new PrivilegedAction(){
  -                    public Object run(){
  -                        return HttpMessages.getMessage(message); 
  -                    }
  -                }
  -           );
  -        } else {
  -            return HttpMessages.getMessage(message);
  -        }
  -    }
   
       /**
        * Send a header.
  
  
  
  1.31      +4 -15     jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java
  
  Index: Http11AprProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProcessor.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- Http11AprProcessor.java	31 Jul 2005 09:23:02 -0000	1.30
  +++ Http11AprProcessor.java	4 Aug 2005 07:07:57 -0000	1.31
  @@ -23,8 +23,6 @@
   import java.util.StringTokenizer;
   import java.util.regex.Pattern;
   import java.util.regex.PatternSyntaxException;
  -import java.security.AccessController;
  -import java.security.PrivilegedAction;
   import java.security.cert.CertificateFactory;
   import java.security.cert.X509Certificate;
   
  @@ -109,6 +107,9 @@
           // Cause loading of HexUtils
           int foo = HexUtils.DEC[0];
   
  +        // Cause loading of FastHttpDateFormat
  +        FastHttpDateFormat.getCurrentDate();
  +
       }
   
   
  @@ -1632,19 +1633,7 @@
           }
   
           // Add date header
  -        String date = null;
  -        if (System.getSecurityManager() != null){
  -            date = (String)AccessController.doPrivileged(
  -                    new PrivilegedAction() {
  -                        public Object run(){
  -                            return FastHttpDateFormat.getCurrentDate();
  -                        }
  -                    }
  -            );
  -        } else {
  -            date = FastHttpDateFormat.getCurrentDate();
  -        }
  -        headers.setValue("Date").setString(date);
  +        headers.setValue("Date").setString(FastHttpDateFormat.getCurrentDate());
   
           // FIXME: Add transfer encoding header
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message