cvs commit: jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/tomcat4 Ajp13Connector.java Ajp13InputStream.java Ajp13OutputStream.java Ajp13Processor.java Ajp13Request.java Ajp13Response.java Ajp13.java

2001-05-15 Thread seguin

seguin  01/05/15 08:23:07

  Modified:jk/src/java/org/apache/ajp Ajp13Packet.java
   jk/src/java/org/apache/ajp/tomcat4 Ajp13Connector.java
Ajp13InputStream.java Ajp13OutputStream.java
Ajp13Processor.java Ajp13Request.java
Ajp13Response.java
  Added:   jk/src/java/org/apache/ajp Ajp13.java AjpRequest.java
MessageBytes.java
   jk/src/java/org/apache/ajp/test TestAjp13.java
  Removed: jk/src/java/org/apache/ajp/tomcat4 Ajp13.java
  Log:
  refactoring...  a work in progress...
  
  Revision  ChangesPath
  1.2   +14 -13
jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/Ajp13Packet.java
  
  Index: Ajp13Packet.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/Ajp13Packet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Ajp13Packet.java  2001/05/12 05:52:39 1.1
  +++ Ajp13Packet.java  2001/05/15 15:22:23 1.2
  @@ -68,6 +68,9 @@
* packets.  
*/
   public class Ajp13Packet {
  +
  +public static final String DEFAULT_CHAR_ENCODING = "8859_1";
  +
   byte buff[]; // Holds the bytes of the packet
   int pos; // The current read or write position in the buffer
   
  @@ -129,7 +132,7 @@
   /**
* Prepare this packet for accumulating a message from the container to
* the web server.  Set the write position to just after the header
  - * (but leave the length unwritten, because it is as yet unknown).  
  + * (but leave the length unwritten, because it is as yet unknown).
*/
   public void reset() {
   len = 4;
  @@ -288,19 +291,17 @@
   public boolean getBool() {
   return (getByte() == (byte) 1);
   }
  -
  -public static final String DEFAULT_CHAR_ENCODING = "8859_1";
   
  -//  public void getMessageBytes( MessageBytes mb ) {
  -//  int length = getInt();
  -//  if( (length == 0x) || (length == -1) ) {
  -//  mb.setString( null );
  -//  return;
  -//  }
  -//  mb.setBytes( buff, pos, length );
  -//  pos += length;
  -//  pos++; // Skip the terminating \0
  -//  }
  +public void getMessageBytes(MessageBytes mb) {
  +int length = getInt();
  +if( (length == 0x) || (length == -1) ) {
  +mb.setString( null );
  +return;
  +}
  +mb.setBytes( buff, pos, length );
  +pos += length;
  +pos++; // Skip the terminating \0
  +}
   
   //  public MessageBytes addHeader( MimeHeaders headers ) {
   //  int length = getInt();
  
  
  
  1.1  jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/Ajp13.java
  
  Index: Ajp13.java
  ===
  /*
   * 
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *any, must include the following acknowlegement:
   *   "This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/)."
   *Alternately, this acknowlegement may appear in the software itself,
   *if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *Foundation" must not be used to endorse or promote products derived
   *from this software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache"
   *nor may "Apache" appear in their names without prior written
   *permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECI

cvs commit: jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/tomcat4 Ajp13Connector.java

2001-05-11 Thread seguin

seguin  01/05/11 23:16:40

  Modified:jk/src/java/org/apache/ajp/tomcat4 Ajp13Connector.java
  Log:
  add setters/getters for redirect port and enabling dns lookup.
  
  Revision  ChangesPath
  1.2   +48 -4 
jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/tomcat4/Ajp13Connector.java
  
  Index: Ajp13Connector.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/tomcat4/Ajp13Connector.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Ajp13Connector.java   2001/05/12 05:52:40 1.1
  +++ Ajp13Connector.java   2001/05/12 06:16:39 1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/tomcat4/Ajp13Connector.java,v
 1.1 2001/05/12 05:52:40 seguin Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/05/12 05:52:40 $
  + * $Header: 
/home/cvs/jakarta-tomcat-connectors/jk/src/java/org/apache/ajp/tomcat4/Ajp13Connector.java,v
 1.2 2001/05/12 06:16:39 seguin Exp $
  + * $Revision: 1.2 $
  + * $Date: 2001/05/12 06:16:39 $
*
* 
*
  @@ -92,7 +92,7 @@
* Implementation of an Ajp13 connector.
*
* @author Kevin Seguin
  - * @version $Revision: 1.1 $ $Date: 2001/05/12 05:52:40 $
  + * @version $Revision: 1.2 $ $Date: 2001/05/12 06:16:39 $
*/
   
   
  @@ -160,6 +160,16 @@
   
   
   /**
  + * redirect port.
  + */
  +private int redirectPort = -1;
  +
  +/**
  + * enable DNS lookups.
  + */
  +private boolean enableLookups = false;
  +
  +/**
* The lifecycle event support for this component.
*/
   protected LifecycleSupport lifecycle = new LifecycleSupport(this);
  @@ -415,6 +425,40 @@
   
   }
   
  +/**
  + * Return the "enable DNS lookups" flag.
  + */
  +public boolean getEnableLookups() {
  +return this.enableLookups;
  +}
  +
  +/**
  + * Set the "enable DNS lookups" flag.
  + *
  + * @param enableLookups The new "enable DNS lookups" flag value
  + */
  +public void setEnableLookups(boolean enableLookups) {
  +this.enableLookups = enableLookups;
  +}
  +
  +/**
  + * Return the port number to which a request should be redirected if
  + * it comes in on a non-SSL port and is subject to a security constraint
  + * with a transport guarantee that requires SSL.
  + */
  +public int getRedirectPort() {
  +return this.redirectPort;
  +}
  +
  +
  +/**
  + * Set the redirect port number.
  + *
  + * @param redirectPort The redirect port number (non-SSL to SSL)
  + */
  +public void setRedirectPort(int redirectPort) {
  +this.redirectPort = redirectPort;
  +}
   
   /**
* Return the server socket factory used by this Container.