tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat33 Ajp14Interceptor.java
Date Sun, 24 Jun 2001 21:17:13 GMT
costin      01/06/24 14:17:13

  Modified:    jk/java/org/apache/ajp/tomcat33 Ajp14Interceptor.java
  Log:
  Fixes for the code move.
  
  One big missing chunk is the adapter between o.a.ajp.AjpRequest and
  tomcat33 request ( similar with the one for tomcat4 ).
  I'm working on this.
  
  Revision  Changes    Path
  1.3       +37 -7     jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat33/Ajp14Interceptor.java
  
  Index: Ajp14Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat33/Ajp14Interceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Ajp14Interceptor.java	2001/06/23 19:04:34	1.2
  +++ Ajp14Interceptor.java	2001/06/24 21:17:13	1.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat33/Ajp14Interceptor.java,v
1.2 2001/06/23 19:04:34 costin Exp $
  - * $Revision: 1.2 $
  - * $Date: 2001/06/23 19:04:34 $
  + * $Header: /home/cvs/jakarta-tomcat-connectors/jk/java/org/apache/ajp/tomcat33/Ajp14Interceptor.java,v
1.3 2001/06/24 21:17:13 costin Exp $
  + * $Revision: 1.3 $
  + * $Date: 2001/06/24 21:17:13 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,12 @@
   import java.io.*;
   import java.net.*;
   import java.util.*;
  +
  +import org.apache.ajp.*;
  +
  +import org.apache.tomcat.modules.server.*;
   import org.apache.tomcat.core.*;
  +
   import org.apache.tomcat.util.net.*;
   import org.apache.tomcat.util.*;
   import org.apache.tomcat.util.log.*;
  @@ -90,6 +95,7 @@
       implements  TcpConnectionHandler
   {
       int ajp14_note=-1;
  +    String password;
       
       public Ajp14Interceptor()
       {
  @@ -104,6 +110,10 @@
   
       // -------------------- Ajp14 specific parameters --------------------
   
  +    public void setPassword( String s ) {
  +	log( "Password=" + s);
  +	this.password=s;
  +    }
   
       
       // -------------------- PoolTcpConnector --------------------
  @@ -154,7 +164,12 @@
   	}
   	// either thData==null or broken ( req==null)
   	Ajp14 ajp14=new Ajp14();
  -	req=new Ajp14Request(ajp14);
  +	ajp14.setContainerSignature( ContextManager.TOMCAT_NAME +
  +				     " v" + ContextManager.TOMCAT_VERSION);
  +	AjpRequest ajpreq=new AjpRequest();
  +	log( "Setting pass " + password );
  +	ajp14.setPassword( password );
  +	req=new Ajp14Request(ajp14, ajpreq);
   	Ajp14Response res=new Ajp14Response(ajp14);
   	cm.initRequest(req, res);
   	return  req;
  @@ -174,16 +189,29 @@
               Ajp14Request req=initRequest( thData );
               Ajp14Response res= (Ajp14Response)req.getResponse();
               Ajp14 ajp14=req.ajp14;
  +	    AjpRequest ajpReq=req.ajpReq;
   
               ajp14.setSocket(socket);
   
   	    if( debug>0)
   		log( "Received ajp14 connection ");
  +
  +	    // first request should be the loginit.
  +	    int status=ajp14.receiveNextRequest( ajpReq );
  +	    if( status != 304 )  { // XXX use better codes
  +		log( "Failure in logInit ");
  +		return;
  +	    }
  +
  +	    status=ajp14.receiveNextRequest( ajpReq );
  +	    if( status != 304 ) { // XXX use better codes
  +		log( "Failure in login ");
  +		return;
  +	    }
   	    
               boolean moreRequests = true;
               while(moreRequests) {
  -		// first request should be the logon.
  -		int status=ajp14.receiveNextRequest( req );
  +		status=ajp14.receiveNextRequest( ajpReq );
   
   		if( status==-2) {
   		    // special case - shutdown
  @@ -254,10 +282,12 @@
   class Ajp14Request extends Request 
   {
       Ajp14 ajp14;
  +    AjpRequest ajpReq;
       
  -    public Ajp14Request(Ajp14 ajp14) 
  +    public Ajp14Request(Ajp14 ajp14, AjpRequest ajpReq) 
       {
           this.ajp14=ajp14;
  +	this.ajpReq=ajpReq;
       }
   
       // XXX This should go away if we introduce an InputBuffer.
  
  
  

Mime
View raw message