tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/net SSLSocketFactory.java
Date Fri, 06 Oct 2000 05:19:22 GMT
costin      00/10/05 22:19:21

  Modified:    src/share/org/apache/tomcat/context DefaultCMSetter.java
               src/share/org/apache/tomcat/core ContextManager.java
                        OutputBuffer.java Request.java
               src/share/org/apache/tomcat/modules/server Ajp12.java
                        Http10Interceptor.java JNIConnectionHandler.java
               src/share/org/apache/tomcat/request StaticInterceptor.java
               src/share/org/apache/tomcat/service/connector
                        Ajp12ConnectionHandler.java
                        Ajp13ConnectorRequest.java
                        JNIConnectionHandler.java
               src/share/org/apache/tomcat/service/http
                        HttpRequestAdapter.java
               src/share/org/apache/tomcat/util MessageBytes.java
               src/share/org/apache/tomcat/util/net SSLSocketFactory.java
  Log:
  - Moved doWrite from ContextManager to OutputBuffer ( context manager was
  an un-necesary middle man ).
  
  - Fix in MessageBytes - reset the cached values when set is called
  
  - First major change in Request - method, uri, query and protocol are
  now MessageButes, as proposed some time ago.
  This follows the 0 GC goal, and is essential for real encoding and
  charset support.
  
  More to come this weekend.
  
  IT seems that most of tomcat 3.3 works again ( more or less - we had some
  big changes ). This weekend I'll try to finish request and everything else
  in core.
  
  Revision  Changes    Path
  1.55      +4 -1      jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java
  
  Index: DefaultCMSetter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/DefaultCMSetter.java,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- DefaultCMSetter.java	2000/10/01 06:37:44	1.54
  +++ DefaultCMSetter.java	2000/10/06 05:18:02	1.55
  @@ -162,7 +162,10 @@
   	    }
   	    ctx.setAbsolutePath( absPath );
   	}
  -	log( ctx.getPath() + " " + docBase + " " + absPath + " " +cm.getHome());
  +	if( debug > 0 ) {
  +	    String h=ctx.getHost();
  +	    log( ((h==null) ? "":h) + ":" + ctx.getPath() + " " + docBase + " " + absPath + "
" +cm.getHome());
  +	}
   	
   	// this would belong to a logger interceptor ?
   	Log loghelper=ctx.getLog();
  
  
  
  1.143     +2 -26     jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.142
  retrieving revision 1.143
  diff -u -r1.142 -r1.143
  --- ContextManager.java	2000/10/01 22:21:44	1.142
  +++ ContextManager.java	2000/10/06 05:18:12	1.143
  @@ -241,8 +241,10 @@
        */
       private String installDir;
   
  +    // "/" on the default host 
       private Context rootContext;
       
  +    // Server properties ( interceptors, etc ) - it's one level above "/"
       private Container defaultContainer;
   
       // the application loader. ContextManager is loaded with
  @@ -1119,30 +1121,4 @@
   	loghelper.log(msg, t, level);
       }
   
  -    // -------------------- Hook support --------------------
  -
  -    /** Implement the write logic, calling the interceptors
  -     *  and making sure the headers are sent before. This used to
  -     *	be part of BufferedServletOutputStream, but it's better
  -     *	to have it here for all output streams.
  -     *  XXX XXX 
  -     */
  -    public final void doWrite(Request req, Response res, byte buf[], int off, int cnt )
  -	throws IOException
  -    {
  -	if (!res.isBufferCommitted()) {
  -	    res.endHeaders();
  -	}
  -	if( cnt>0 ) {
  -	    // call the beforeCommit callback
  -	    BaseInterceptor reqI[]= getInterceptors(req,
  -						    Container.H_beforeCommit);
  -
  -	    for( int i=0; i< reqI.length; i++ ) {
  -		reqI[i].beforeCommit( req, res );
  -	    }
  -
  -	    res.doWrite( buf, off, cnt );
  -	}
  -    }
   }
  
  
  
  1.7       +32 -8     jakarta-tomcat/src/share/org/apache/tomcat/core/OutputBuffer.java
  
  Index: OutputBuffer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/OutputBuffer.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- OutputBuffer.java	2000/09/29 07:01:02	1.6
  +++ OutputBuffer.java	2000/10/06 05:18:13	1.7
  @@ -114,6 +114,30 @@
   	System.out.println("OutputBuffer: " + s );
       }
   
  +    /** Sends the buffer data to the client output, checking the
  +	state of Response and calling the right interceptors.
  +    */
  +    private void realWrite(Request req, Response res, byte buf[], int off, int cnt )
  +	throws IOException
  +    {
  +	// If this is the first write ( or flush )
  +	if (!res.isBufferCommitted()) {
  +	    res.endHeaders();
  +	}
  +	// If we really have something to write
  +	if( cnt>0 ) {
  +	    // call the beforeCommit callback
  +	    BaseInterceptor reqI[]= cm.getInterceptors(req,
  +						       Container.H_beforeCommit);
  +	    for( int i=0; i< reqI.length; i++ ) {
  +		reqI[i].beforeCommit( req, res );
  +	    }
  +
  +	    // real write to the adapter
  +	    res.doWrite( buf, off, cnt );
  +	}
  +    }
  +    
       public void recycle() {
   	if( debug > 0 ) log("recycle()");
   	state=INITIAL_STATE;
  @@ -173,12 +197,12 @@
   	    System.arraycopy(b, off+avail, buf, count, len - avail);
   	    count+= len - avail;
   	    bytesWritten += len - avail;
  -	}
  -
  -	// len > buf.length + avail
  -	else {
  -	  flushBytes();
  -	  cm.doWrite( req, resp, b, off, len );
  +	
  +	} else {	// len > buf.length + avail
  +	    // long write - flush the buffer and write the rest
  +	    // directly from source
  +	    flushBytes();
  +	    realWrite( req, resp, b, off, len );
   	}
   
   	// if called from within flush(), then immediately flush
  @@ -339,7 +363,7 @@
           else if (state==BYTE_STATE)
               flushBytes();
           else if (state==INITIAL_STATE)
  -            cm.doWrite( req, resp, null, 0, 0 );       // nothing written yet
  +            realWrite( req, resp, null, 0, 0 );       // nothing written yet
           doFlush = false;
       }
   
  @@ -384,7 +408,7 @@
       public void flushBytes() throws IOException {
   	if( debug > 0 ) log("flushBytes() " + count);
   	if( count > 0) {
  -	    cm.doWrite( req, resp, buf, 0, count );
  +	    realWrite( req, resp, buf, 0, count );
   	    count=0;
   	}
       }
  
  
  
  1.68      +25 -45    jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java
  
  Index: Request.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Request.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- Request.java	2000/10/01 22:21:44	1.67
  +++ Request.java	2000/10/06 05:18:17	1.68
  @@ -130,7 +130,6 @@
       // Processed information ( redundant ! )
       protected Hashtable parameters = new Hashtable();
   
  -
       protected int contentLength = -1;
       protected String contentType = null;
       protected String charEncoding = null;
  @@ -149,23 +148,20 @@
       protected Response response;
       protected ContextManager contextM;
       protected Context context;
  +    protected Object requestFacade;
   
       protected boolean didReadFormData;
       protected boolean didParameters;
       // end "Request" variables
   
  -    // @deprecated
  -    protected Object requestFacade;
  -
       // Session
  -    // set by interceptors - the session id
       protected String reqSessionId;
       protected String sessionIdSource;
       protected String sessionId;
  -        
       // cache- avoid calling SessionManager for each getSession()
       protected ServerSession serverSession;
   
  +    // Handler
       protected Handler handler = null;
       Container container;
   
  @@ -176,22 +172,12 @@
       Request parent;
       Request child;
   
  -    // @deprecated
  -    protected String method;
  -    protected String requestURI;
  -    protected String queryString;
  -    protected String protocol;
  -    
  -    protected String servletName;
  -    protected String mappedPath = null;
       protected String contextPath;
  -    protected String lookupPath; // everything after contextPath before ?
       protected String servletPath;
       protected String pathInfo;
       protected String pathTranslated;
  -    // Need to distinguish between null pathTranslated and
  -    // lazy-computed pathTranlsated
       protected boolean pathTranslatedIsSet=false;
  +
       protected Vector cookies = new Vector();
       protected boolean didCookies;
   
  @@ -265,35 +251,35 @@
       }
   
       public String getMethod() {
  -        return method;
  +        return methodMB.toString();
       }
   
       public void setMethod( String method ) {
  -	this.method=method;
  +	methodMB.setString(method);
       }
   
       public String getRequestURI() {
  -	return requestURI;
  +	return uriMB.toString();
       }
   
       public void setRequestURI( String r ) {
  - 	this.requestURI=r;
  + 	uriMB.setString(r);
       }
   
       public String getQueryString() {
  -        return queryString;
  +        return queryMB.toString();
       }
   
       public void setQueryString(String queryString) {
  -	this.queryString = queryString;
  +	queryMB.setString(queryString);
       }
   
       public String getProtocol() {
  -        return protocol;
  +        return protoMB.toString();
       }
   
       public void setProtocol( String protocol ) {
  -	this.protocol=protocol;
  +	protoMB.setString(protocol);
       }
   
   
  @@ -677,17 +663,6 @@
   	this.container=container;
       }
   
  -//     /** The file - result of mapping the request ( using aliases and other
  -//      *  mapping rules. Usefull only for static resources.
  -//      */
  -//     public String getMappedPath() {
  -// 	return mappedPath;
  -//     }
  -
  -//     public void setMappedPath( String m ) {
  -// 	mappedPath=m;
  -//     }
  -
       public void setParameters( Hashtable h ) {
   	if(h!=null)
   	    this.parameters=h;
  @@ -900,10 +875,6 @@
           container=null;
           handler=null;
           jvmRoute = null;
  -        method = "GET";
  -        requestURI="/";
  -        queryString=null;
  -        protocol="HTTP/1.0";
           headers.clear(); // XXX use recycle pattern
           serverName=null;
           serverPort=8080;
  @@ -913,16 +884,16 @@
           sessionIdSource = null;
   	sessionId=null;
   
  -        // XXX a request need to override those if it cares
  -        // about security
  -        remoteAddr="127.0.0.1";
  -        remoteHost="localhost";
  -        localHost="localhost";
  +	// counters and notes
           cntr.recycle();
           for( int i=0; i<ContextManager.MAX_NOTES; i++ ) notes[i]=null;
  +
  +	// sub-req
   	parent=null;
   	child=null;
   	top=null;
  +
  +	// auth
           notAuthenticated=true;
   	userRoles=null;
   	reqRoles=null;
  @@ -934,7 +905,16 @@
   	queryMB.recycle();
   	methodMB.recycle();
   	protoMB.recycle();
  +
  +	// XXX Do we need such defaults ?
           schemeMB.setString("http");
  +	methodMB.setString("GET");
  +        uriMB.setString("/");
  +        queryMB.setString("");
  +        protoMB.setString("HTTP/1.0");
  +        remoteAddr="127.0.0.1";
  +        remoteHost="localhost";
  +        localHost="localhost";
   
       }
   }
  
  
  
  1.4       +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java
  
  Index: Ajp12.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Ajp12.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Ajp12.java	2000/09/29 21:09:43	1.3
  +++ Ajp12.java	2000/10/06 05:18:47	1.4
  @@ -132,7 +132,7 @@
   		    //	req.setContext( contextM.getContext( contextPath ));
   		    
   		    //Servlet - not used
  -		    String servletName = readString(ajpin, null);
  +		    dummy=readString(ajpin, null);
   		    
   		    //Server hostname
   		    req.setServerName( readString(ajpin, null) );
  
  
  
  1.4       +4 -4      jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java
  
  Index: Http10Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/Http10Interceptor.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Http10Interceptor.java	2000/09/29 07:01:18	1.3
  +++ Http10Interceptor.java	2000/10/06 05:18:53	1.4
  @@ -207,10 +207,10 @@
       public void readNextRequest(Response response) throws IOException {
   	int status=http.processRequestLine( methodMB, uriMB,queryMB, protoMB );
   	// XXX remove this after we swich to MB
  -	method=methodMB.toString();
  -	requestURI=uriMB.toString();
  -	queryString=queryMB.toString();
  -	protocol=protoMB.toString();
  +	// 	method=methodMB.toString();
  +	// 	requestURI=uriMB.toString();
  +	// 	queryString=queryMB.toString();
  +	// 	protocol=protoMB.toString();
   	
   	if( status > 200 ) {
   	    response.setStatus( status );
  
  
  
  1.3       +15 -13    jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIConnectionHandler.java
  
  Index: JNIConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIConnectionHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JNIConnectionHandler.java	2000/09/24 18:09:58	1.2
  +++ JNIConnectionHandler.java	2000/10/06 05:18:54	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIConnectionHandler.java,v
1.2 2000/09/24 18:09:58 costin Exp $
  - * $Revision: 1.2 $
  - * $Date: 2000/09/24 18:09:58 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/server/JNIConnectionHandler.java,v
1.3 2000/10/06 05:18:54 costin Exp $
  + * $Revision: 1.3 $
  + * $Date: 2000/10/06 05:18:54 $
    *
    * ====================================================================
    *
  @@ -300,9 +300,9 @@
            * Read the environment
            */
           if(h.readEnvironment(s, l, env) > 0) {
  -    		method      = env[0];
  -    		requestURI  = env[1];
  -    		queryString = env[2];
  +    		methodMB.setString( env[0] );
  +    		uriMB.setString( env[1] );
  +    		queryMB.setString( env[2] );
       		remoteAddr  = env[3];
       		remoteHost  = env[4];
       		serverName  = env[5];
  @@ -310,7 +310,7 @@
               authType    = env[7];
               remoteUser  = env[8];
               schemeMB.setString(env[9]);
  -            protocol    = env[10];
  +            protoMB.setString( env[10]);
               // response.setServerHeader(env[11]);
               
               if(schemeMB.equalsIgnoreCase("https")) {
  @@ -351,12 +351,14 @@
               }
           }
   
  -	    // REQUEST_URI may include a query string
  -	    int idQ= requestURI.indexOf("?");
  -	    if ( idQ > -1) {
  -    	    requestURI = requestURI.substring(0, idQ);
  -        }
  -
  +	// REQUEST_URI may include a query string
  +	String requestURI=uriMB.toString();
  +	int indexQ=requestURI.indexOf("?");
  +	int rLen=requestURI.length();
  +	if ( (indexQ >-1) && ( indexQ  < rLen) ) {
  +	    queryMB.setString( requestURI.substring(indexQ + 1, requestURI.length()));
  +	    uriMB.setString( requestURI.substring(0, indexQ));
  +	} 
       }
   }
   
  
  
  
  1.23      +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java
  
  Index: StaticInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/StaticInterceptor.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- StaticInterceptor.java	2000/10/01 06:37:50	1.22
  +++ StaticInterceptor.java	2000/10/06 05:19:10	1.23
  @@ -129,7 +129,7 @@
   	String absPath=FileUtil.safePath( ctx.getAbsolutePath(),
   					  pathInfo);
   
  -	if( debug > -1 ) log( "RequestMap " + req + " " + absPath + " " + ctx.getAbsolutePath()
);
  +	if( debug > 0 ) log( "RequestMap " + req + " " + absPath + " " + ctx.getAbsolutePath()
);
   	if( absPath == null ) return 0;
   	String requestURI=req.getRequestURI();
   
  
  
  
  1.40      +15 -16    jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp12ConnectionHandler.java
  
  Index: Ajp12ConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp12ConnectionHandler.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- Ajp12ConnectionHandler.java	2000/10/01 22:21:46	1.39
  +++ Ajp12ConnectionHandler.java	2000/10/06 05:19:12	1.40
  @@ -231,7 +231,7 @@
   		    break;
   		    
   		case 1: //beginning of request
  -		    method = readString(ajpin, null);              //Method
  +		    methodMB.setString( readString(ajpin, null));              //Method
   		    
   		    contextPath = readString(ajpin, null);               //Zone
   		    // GS, the following commented line causes the Apache + Jserv + Tomcat
  @@ -245,8 +245,7 @@
   		    // 			context=contextM.getContext( contextPath );
   		    // 		    if( doLog ) d("AJP: context=" + context );
   		    
  -		    servletName = readString(ajpin, null);         //Servlet
  -		    if( doLog ) d("AJP: servlet=" + servletName );
  +		    dummy = readString(ajpin, null);         //Servlet
   		    
   		    serverName = readString(ajpin, null);            //Server hostname
   		    if( doLog ) d("AJP: serverName=" + serverName );
  @@ -260,8 +259,8 @@
   		    pathTranslated = readString(ajpin, null);               //Apache parsed path-translated
   		    if( doLog ) d("AJP: PT=" + pathTranslated );
   		    
  -		    queryString = readString(ajpin, null);         //query string
  -		    if( doLog ) d("AJP: QS=" + queryString );
  +		    queryMB.setString( readString(ajpin, null));         //query string
  +		    if( doLog ) d("AJP: QS=" + queryMB.toString() );
   		    
   		    remoteAddr = readString(ajpin, "");            //remote address
   		    if( doLog ) d("AJP: RA=" + remoteAddr );
  @@ -277,17 +276,16 @@
   		    
   		    dummy = readString(ajpin, null);                 //remote port
   		    
  -		    method = readString(ajpin, null);                //request method
  -		    if( doLog ) d("AJP: Meth=" + method );
  +		    methodMB.setString( readString(ajpin, null));                //request method
  +		    if( doLog ) d("AJP: Meth=" + methodMB.toString() );
   		    
  -		    requestURI = readString(ajpin, "");             //request uri
  -		    if( doLog ) d("AJP: URI: " + requestURI + " CP:" + contextPath + " LP: " + lookupPath);
  +		    uriMB.setString( readString(ajpin, ""));             //request uri
  +		    if( doLog ) d("AJP: URI: " + uriMB.toString() + " CP:" + contextPath );
   
   		    // XXX don't set lookup path - problems with URL rewriting.
   		    // need to be fixed.
   		    //		if(contextPath!=null && contextPath.length() >0 )
   		    //		    lookupPath=requestURI.substring( contextPath.length() + 1 );
  -		    if( doLog ) d("AJP: URI: " + requestURI + " CP:" + contextPath + " LP: " + lookupPath);
   		    
   		    dummy = readString(ajpin, null);                   //script filename
   		    //		System.out.println("AJP: Script filen=" + dummy);
  @@ -428,17 +426,18 @@
           }
   	
   	// REQUEST_URI includes query string
  +	String requestURI=uriMB.toString();
   	int indexQ=requestURI.indexOf("?");
   	int rLen=requestURI.length();
   	if ( (indexQ >-1) && ( indexQ  < rLen) ) {
  -	    if(doLog) d("Orig QS " + queryString );
  -	    queryString = requestURI.substring(indexQ + 1, requestURI.length());
  -	    if(doLog) d("New QS " + queryString );
  -	    requestURI = requestURI.substring(0, indexQ);
  +	    if(doLog) d("Orig QS " + queryMB.toString() );
  +	    queryMB.setString( requestURI.substring(indexQ + 1, requestURI.length()));
  +	    if(doLog) d("New QS " + queryMB.toString() );
  +	    uriMB.setString( requestURI.substring(0, indexQ));
   	} 
   	
  -	if( doLog ) d("Request: " + requestURI );
  -	if( doLog ) d("Query: " + queryString );
  +	if( doLog ) d("Request: " + uriMB.toString() );
  +	if( doLog ) d("Query: " + queryMB.toString() );
   	// System.out.println("ENV: " + env_vars );
   	// 	System.out.println("HEADERS: " + headers_in );
   	// 	System.out.println("PARAMETERS: " + parameters );
  
  
  
  1.13      +7 -7      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java
  
  Index: Ajp13ConnectorRequest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Ajp13ConnectorRequest.java	2000/09/25 07:20:58	1.12
  +++ Ajp13ConnectorRequest.java	2000/10/06 05:19:12	1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v
1.12 2000/09/25 07:20:58 costin Exp $
  - * $Revision: 1.12 $
  - * $Date: 2000/09/25 07:20:58 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v
1.13 2000/10/06 05:19:12 costin Exp $
  + * $Revision: 1.13 $
  + * $Date: 2000/10/06 05:19:12 $
    *
    * ====================================================================
    *
  @@ -137,9 +137,9 @@
            * Read the method and translate it to a String
            */
           bsc        = msg.getByte();
  -        method     = methodTransArray[(int)bsc - 1];
  -        protocol   = msg.getString();
  -        requestURI = msg.getString();
  +        methodMB.setString ( methodTransArray[(int)bsc - 1] );
  +        protoMB.setString(  msg.getString() );
  +        uriMB.setString( msg.getString());
           remoteAddr = msg.getString();
           remoteHost = msg.getString();
           serverName = msg.getString();
  @@ -189,7 +189,7 @@
                   break;
   
                   case SC_A_QUERY_STRING :
  -                    queryString = msg.getString();
  +                    queryMB.setString( msg.getString());
                   break;
   
                   case SC_A_JVM_ROUTE    :
  
  
  
  1.19      +7 -12     jakarta-tomcat/src/share/org/apache/tomcat/service/connector/JNIConnectionHandler.java
  
  Index: JNIConnectionHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/JNIConnectionHandler.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- JNIConnectionHandler.java	2000/09/25 07:21:00	1.18
  +++ JNIConnectionHandler.java	2000/10/06 05:19:13	1.19
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/JNIConnectionHandler.java,v
1.18 2000/09/25 07:21:00 costin Exp $
  - * $Revision: 1.18 $
  - * $Date: 2000/09/25 07:21:00 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/JNIConnectionHandler.java,v
1.19 2000/10/06 05:19:13 costin Exp $
  + * $Revision: 1.19 $
  + * $Date: 2000/10/06 05:19:13 $
    *
    * ====================================================================
    *
  @@ -255,9 +255,9 @@
            * Read the environment
            */
           if(h.readEnvironment(s, l, env) > 0) {
  -    		method      = env[0];
  -    		requestURI  = env[1];
  -    		queryString = env[2];
  +    		methodMB.setString( env[0] );
  +    		uriMB.setString( env[1] );
  +    		queryMB.setString( env[2] );
       		remoteAddr  = env[3];
       		remoteHost  = env[4];
       		serverName  = env[5];
  @@ -265,7 +265,7 @@
               authType    = env[7];
               remoteUser  = env[8];
               schemeMB.setString(env[9]);
  -            protocol    = env[10];
  +            protoMB.setString( env[10] );
               // response.setServerHeader(env[11]);
               
               if(schemeMB.equalsIgnoreCase("https")) {
  @@ -306,11 +306,6 @@
               }
           }
   
  -	    // REQUEST_URI may include a query string
  -	    int idQ= requestURI.indexOf("?");
  -	    if ( idQ > -1) {
  -    	    requestURI = requestURI.substring(0, idQ);
  -        }
   
       }
   }
  
  
  
  1.33      +17 -17    jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java
  
  Index: HttpRequestAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- HttpRequestAdapter.java	2000/09/29 07:01:32	1.32
  +++ HttpRequestAdapter.java	2000/10/06 05:19:15	1.33
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
1.32 2000/09/29 07:01:32 costin Exp $
  - * $Revision: 1.32 $
  - * $Date: 2000/09/29 07:01:32 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
1.33 2000/10/06 05:19:15 costin Exp $
  + * $Revision: 1.33 $
  + * $Date: 2000/10/06 05:19:15 $
    *
    * ====================================================================
    *
  @@ -155,7 +155,7 @@
   	processRequestLine(response  );
   
   	// for 0.9, we don't have headers!
  -	if (protocol!=null) { // all HTTP versions with protocol also have headers ( 0.9 has no
HTTP/0.9 !)
  +	if (! protoMB.isNull()) { // all HTTP versions with protocol also have headers ( 0.9 has
no HTTP/0.9 !)
   	    readHeaders( headers, sin  );
   	}
   
  @@ -383,22 +383,22 @@
   	}
   
   	methodMB.setBytes( buf, startMethod, endMethod - startMethod );
  -	method=null;
  +// 	method=null;
   	if( Ascii.toLower( buf[startMethod]) == 'g' ) {
   	    if( methodMB.equalsIgnoreCase( "get" ))
  -		method="GET";
  +		methodMB.setString( "GET" );
   	}
   	if( Ascii.toLower( buf[startMethod]) == 'p' ) {
   	    if( methodMB.equalsIgnoreCase( "post" ))
  -		method="POST";
  +		methodMB.setString( "POST" );
   	    if( methodMB.equalsIgnoreCase( "put" ))
  -		method="PUT";
  +		methodMB.setString("PUT");
   	}
   
  -	if( method==null )
  -	    method= new String( buf, startMethod, endMethod - startMethod );
  +// 	if( method==null )
  +// 	    method= new String( buf, startMethod, endMethod - startMethod );
   
  -	protocol=null;
  +// 	protocol=null;
   	if( endReq < 0 ) {
   	    endReq=count;
   	} else {
  @@ -406,12 +406,12 @@
   		if( endProto < 0 ) endProto = count;
   		protoMB.setBytes( buf, startProto, endProto-startProto);
   		if( protoMB.equalsIgnoreCase( "http/1.0" ))
  -		    protocol="HTTP/1.0";
  +		    protoMB.setString( "HTTP/1.0" );
   		if( protoMB.equalsIgnoreCase( "http/1.1" ))
  -		    protocol="HTTP/1.1";
  +		    protoMB.setString( "HTTP/1.1" );
   		
  -		if( protocol==null) 
  -		    protocol=new String( buf, startProto, endProto-startProto );
  +// 		if( protocol==null) 
  +// 		    protocol=new String( buf, startProto, endProto-startProto );
   	    }
   	}
   
  @@ -425,8 +425,8 @@
   	}
   
   	// temp. fix until the rest of the code is changed
  -	requestURI=uriMB.toString();
  -	queryString=queryMB.toString();
  +	//	requestURI=uriMB.toString();
  +	//	queryString=queryMB.toString();
   
   
   	//	loghelper.log("XXX " + method + " " + requestURI + " " + queryString + " " + protocol
);
  
  
  
  1.10      +17 -1     jakarta-tomcat/src/share/org/apache/tomcat/util/MessageBytes.java
  
  Index: MessageBytes.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/MessageBytes.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MessageBytes.java	2000/09/24 20:01:48	1.9
  +++ MessageBytes.java	2000/10/06 05:19:18	1.10
  @@ -136,6 +136,10 @@
   	}
       }
   
  +    public boolean isNull() {
  +	return bytes==null && strValue==null;
  +    }
  +    
       public void reset() {
   	recycle();
       }
  @@ -165,6 +169,7 @@
        * @param len the length of the bytes
        */
       public void setBytes(byte[] b, int off, int len) {
  +	recycle(); // a new value is set, cached values must reset
   	bytes = b;
   	bytesOff = off;
   	bytesLen = len;
  @@ -173,10 +178,15 @@
       }
   
       public void setEncoding( String enc ) {
  +	if( hasByteValue ) {
  +	    hasCharValue=false;
  +	    hasStrValue=false;
  +	}
   	this.enc=enc;
       }
       
       public void setChars( char[] c, int off, int len ) {
  +	recycle();
   	chars=c;
   	charsOff=off;
   	charsLen=len;
  @@ -185,12 +195,14 @@
       }
   
       public void setString( String s ) {
  +	recycle();
   	strValue=s;
   	hasStrValue=true;
   	type=T_STR;
       }
   
       public void setTime(long t) {
  +	recycle();
   	if( dateValue==null)
   	    dateValue=new Date(t);
   	else
  @@ -200,6 +212,7 @@
       }
   
       public void setInt(int i) {
  +	recycle();
   	intValue = i;
   	type = T_INT;
   	hasIntValue=true;
  @@ -218,8 +231,11 @@
   	    try {
   		if( enc==null )
   		    strValue=toStringUTF8();
  -		else
  +		else {
   		    strValue=new String(bytes, bytesOff, bytesLen, enc);
  +		    // this will display when we implement I18N
  +		    System.out.println("Converting from bytes to string using " + enc + ":" + strValue
 );
  +		}
   		return strValue;
   	    } catch (java.io.UnsupportedEncodingException e) {
   		return null;  // can't happen
  
  
  
  1.2       +10 -5     jakarta-tomcat/src/share/org/apache/tomcat/util/net/SSLSocketFactory.java
  
  Index: SSLSocketFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/net/SSLSocketFactory.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SSLSocketFactory.java	2000/08/14 21:54:37	1.1
  +++ SSLSocketFactory.java	2000/10/06 05:19:20	1.2
  @@ -85,6 +85,7 @@
    *
    * @author Harish Prabandham
    * @author Costin Manolache
  + * @author Stefan Freyr Stefansson
    */
   public class SSLSocketFactory
       extends org.apache.tomcat.util.net.ServerSocketFactory
  @@ -188,13 +189,17 @@
   		com.sun.net.ssl.KeyManagerFactory.getInstance(algorithm);
   	    kmf.init( kstore, keyPass.toCharArray());
   
  -	    // XXX I don't know if this is needed
  -//  	    com.sun.net.ssl.TrustManagerFactory tmf = 
  -//  		com.sun.net.ssl.TrustManagerFactory.getInstance("SunX509");
  -// 		tmf.init(kstore);
  +	    // If client authentication is needed, set up TrustManager
  +	    com.sun.net.ssl.TrustManager[] tm = null;
  +	    if( clientAuth) {
  +		com.sun.net.ssl.TrustManagerFactory tmf =
  +                    com.sun.net.ssl.TrustManagerFactory.getInstance("SunX509");
  +		tmf.init(kstore);
  +		tm = tmf.getTrustManagers();
  +	    }
   
   	    // init context with the key managers
  -	    context.init(kmf.getKeyManagers(), null,
  +	    context.init(kmf.getKeyManagers(), tm, 
   			 new java.security.SecureRandom());
   
   	    // create proxy
  
  
  

Mime
View raw message