You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by pi...@apache.org on 2001/07/20 01:45:30 UTC

cvs commit: jakarta-tomcat-connectors/webapp/java WarpConnector.java WarpPacket.java

pier        01/07/19 16:45:30

  Modified:    webapp/java WarpConnector.java WarpPacket.java
  Log:
  Forgot bean method to set port.
  Added applications table.
  
  Revision  Changes    Path
  1.16      +34 -0     jakarta-tomcat-connectors/webapp/java/WarpConnector.java
  
  Index: WarpConnector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpConnector.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WarpConnector.java	2001/07/19 02:45:33	1.15
  +++ WarpConnector.java	2001/07/19 23:45:30	1.16
  @@ -122,6 +122,8 @@
       private int acceptCount=10;
       /** The server appBase for hosts created via WARP. */
       private String appBase="webapps";
  +    /** The debug level. */
  +    private int debug=0;
   
       /* -------------------------------------------------------------------- */
       /* Lifecycle variables */
  @@ -333,6 +335,13 @@
       }
   
       /**
  +     * Return the port to which this <code>Connector</code> will bind to.
  +     */
  +    public void setPort(int port) {
  +        this.port=port;
  +    }
  +
  +    /**
        * Set the IP address to which this <code>Connector</code> will bind to.
        *
        * @param address The bind IP address
  @@ -383,6 +392,20 @@
           if (Constants.DEBUG) logger.debug("Setting appBase to "+appBase);
       }
   
  +    /**
  +     * Return the debug level.
  +     */
  +    public int getDebug() {
  +        return(this.debug);
  +    }
  +
  +    /**
  +     * Set the debug level.
  +     */
  +    public void setDebug(int debug) {
  +        this.debug=debug;
  +    }
  +
       /* ==================================================================== */
       /* Lifecycle methods                                                    */
       /* ==================================================================== */
  @@ -459,6 +482,17 @@
               id=this.applications.indexOf(context);
           }
           return(id);
  +    }
  +
  +    /**
  +     * Return the application for a given ID.
  +     */
  +    protected Context applicationContext(int id) {
  +        try {
  +            return((Context)this.applications.elementAt(id));
  +        } catch (ArrayIndexOutOfBoundsException e) {
  +            return(null);
  +        }
       }
   
       /**
  
  
  
  1.12      +6 -8      jakarta-tomcat-connectors/webapp/java/WarpPacket.java
  
  Index: WarpPacket.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/webapp/java/WarpPacket.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- WarpPacket.java	2001/07/15 08:40:58	1.11
  +++ WarpPacket.java	2001/07/19 23:45:30	1.12
  @@ -181,9 +181,8 @@
           if ((this.pointer+2)>this.size)
               throw new ArrayIndexOutOfBoundsException("No data available");
   
  -        int k=0;
  -        k=(k<<8)|(this.buffer[this.pointer++]);
  -        k=(k<<8)|(this.buffer[this.pointer++]);
  +        int k=(this.buffer[this.pointer++])&0xff;
  +        k=(k<<8)+((this.buffer[this.pointer++])&0xff);
   
           return(k);
       }
  @@ -199,11 +198,10 @@
           if ((this.pointer+4)>this.size)
               throw new ArrayIndexOutOfBoundsException("No data available");
   
  -        int k=0;
  -        k=(k<<8)|(this.buffer[this.pointer++]);
  -        k=(k<<8)|(this.buffer[this.pointer++]);
  -        k=(k<<8)|(this.buffer[this.pointer++]);
  -        k=(k<<8)|(this.buffer[this.pointer++]);
  +        int k=(this.buffer[this.pointer++])&0xff;
  +        k=(k<<8)+((this.buffer[this.pointer++])&0xff);
  +        k=(k<<8)+((this.buffer[this.pointer++])&0xff);
  +        k=(k<<8)+((this.buffer[this.pointer++])&0xff);
   
           return(k);
       }