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/startup EmbededTomcat.java
Date Sat, 12 Aug 2000 04:55:49 GMT
costin      00/08/11 21:55:48

  Modified:    src/share/org/apache/tomcat/context
                        LoadOnStartupInterceptor.java
               src/share/org/apache/tomcat/core ContextManager.java
                        Request.java Response.java
               src/share/org/apache/tomcat/request
                        AccountingInterceptor.java
               src/share/org/apache/tomcat/service/connector
                        Ajp12ConnectionHandler.java
                        Ajp13ConnectorRequest.java
                        Ajp13ConnectorResponse.java
                        JNIConnectionHandler.java
               src/share/org/apache/tomcat/service/http
                        HttpRequestAdapter.java HttpResponseAdapter.java
               src/share/org/apache/tomcat/startup EmbededTomcat.java
  Removed:     src/share/org/apache/tomcat/core RequestImpl.java
                        ResponseImpl.java
  Log:
  Moved back to Request/Response as classes. So far the usage was to extend
  Request/Response and override 2-3 methods, and it is likely this will
  be simplified and optimized.
  
  With re-usable object we can also make most of the Request fields final,
  adding a bit more performance.
  
  Revision  Changes    Path
  1.20      +2 -2      jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java
  
  Index: LoadOnStartupInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/context/LoadOnStartupInterceptor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- LoadOnStartupInterceptor.java	2000/08/11 21:19:51	1.19
  +++ LoadOnStartupInterceptor.java	2000/08/12 04:55:45	1.20
  @@ -151,8 +151,8 @@
   	// Ugly code to trick JSPServlet into loading this.
   	ContextManager cm=context.getContextManager();
   	String path=result.getPath();
  -	RequestImpl request = new RequestImpl();
  -	ResponseImpl response = new ResponseImpl();
  +	Request request = new Request();
  +	Response response = new Response();
   	request.setContextManager( cm );
   	request.recycle();
   	response.recycle();
  
  
  
  1.113     +4 -6      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.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- ContextManager.java	2000/08/11 21:19:58	1.112
  +++ ContextManager.java	2000/08/12 04:55:45	1.113
  @@ -601,7 +601,7 @@
   	resp.setRequest( req );
   	req.setResponse( resp );
   	req.setContextManager( this );
  -	((ResponseImpl)resp).init();
  +	resp.init();
       }
   
       /** This is the entry point in tomcat - the connectors ( or any other
  @@ -867,9 +867,7 @@
   
   	/** Creates an "internal" request
   	 */
  -	RequestImpl lr = new RequestImpl();
  -	//	RequestAdapterImpl reqA=new RequestAdapterImpl();
  -	//lr.setRequestAdapter( reqA);
  +	Request lr = new Request();
   	lr.setRequestURI( urlPath );
   	lr.setQueryString( queryString );
   	//	lr.processQueryString();
  @@ -992,8 +990,8 @@
   	if( ! path.startsWith( "/" ) ) {
   	    return ctx.getServletByName( path );
   	}
  -	RequestImpl req1=new RequestImpl();
  -	ResponseImpl res1=new ResponseImpl();
  +	Request req1=new Request();
  +	Response res1=new Response();
   	initRequest( req1, res1 );
   
   	req1.setRequestURI( ctx.getPath() + path );
  
  
  
  1.51      +825 -255  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.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- Request.java	2000/08/11 06:14:06	1.50
  +++ Request.java	2000/08/12 04:55:45	1.51
  @@ -60,9 +60,11 @@
   
   package org.apache.tomcat.core;
   
  +import org.apache.tomcat.facade.*;
   import org.apache.tomcat.util.*;
  -import java.io.*;
  +import org.apache.tomcat.logging.*;
   import java.io.IOException;
  +import java.io.*;
   import java.net.*;
   import java.security.*;
   import java.util.*;
  @@ -72,284 +74,852 @@
   
   /**
    *
  + * @author James Duncan Davidson [duncan@eng.sun.com]
  + * @author James Todd [gonzo@eng.sun.com]
  + * @author Jason Hunter [jch@eng.sun.com]
  + * @author Harish Prabandham
  + * @author Alex Cruikshank [alex@epitonic.com]
  + * @author Hans Bergsten [hans@gefionsoftware.com]
    */
  -public interface Request  {
  -
  -    // -------------------- Basic Request properties --------------------
  -    public String getScheme() ;
  -
  -    public void setScheme( String r ) ;
  -
  -    public String getMethod() ;
  -
  -    public void setMethod( String s );
  -    
  -    public String getRequestURI() ;
  -
  -    public void setRequestURI(String s) ;
  -
  -    public String getQueryString() ;
  -
  -    public void setQueryString(String q) ;
  -
  -    public String getProtocol() ;
  -
  -    public void setProtocol(String p) ;
  -
  -    // -------------------- Connection information
  -    public String getServerName() ;
  -
  -    public void setServerName(String serverName) ;
  -
  -    public int getServerPort() ;
  -
  -    public void setServerPort( int i );
  -
  -    public String getRemoteAddr() ;
  -
  -    public void setRemoteAddr(String remote) ;
  -
  -    /** Expensive - should be implemented as a callback where
  -     *  possible!
  -    */
  -    public String getRemoteHost() ;
  -
  -    public void setRemoteHost(String s) ;
  -
  -    public String getLocalHost() ;
  -
  -    public void setLocalHost(String host) ;
  -    
  -    // -------------------- Headers --------------------
  -    public MimeHeaders getMimeHeaders();
  -
  -    public String getHeader(String name) ;
  -
  -    public Enumeration getHeaderNames() ;
  -
  -    public Enumeration getHeaders(String name) ;
  -
  -    //-------------------- "Computed" properties --------------------
  -    // ( directly derived from headers or request paths )
  -    public Cookie getCookie( int idx );
  -
  -    public int getCookieCount();
  -
  -    public int getContentLength() ;
  -
  -    public void setContentLength( int  len ) ;
  -
  -    public String getContentType() ;
  -
  -    public void setContentType( String type ) ;
  -
  -    public void setCharEncoding( String enc ) ;
  -
  -    public String getCharacterEncoding() ;
  -
  -    // -------------------- Mapping --------------------
  -    // Will be set by mappers or
  -    // by adapter
  -
  -    /** Context - will be set by contextMap stage of request interceptors
  -     */
  -    public void setContext(Context context) ;
  -
  -    public Context getContext() ;
  -
  -    /** Real Path - should be implemented as a callback ( override it in adapters).
  -     *  Map interceptor should set it to something reasonable ( context home + path )
  -     *  MappedPath is similar - it contain mappings inside a context, for normal
  -     *      contexts pathTranslated==context.docBase + mappedPath
  -     */
  -    String getPathTranslated() ;
  -
  -    /**
  -     */
  -    void setPathTranslated(String path) ;
  -
  -    /** Path Info - set be mappers or from adapter
  -     */
  -    public String getPathInfo() ;
  -
  -    public void setPathInfo(String pathInfo) ;
  -
  -    /** Servlet Path
  -     */
  -    public void setServletPath(String servletPath) ;
  -
  -    public String getServletPath() ;
  -
  -
  -    public Container getContainer() ;
  -
  -    public void setContainer(Container handler) ;
  -
  -    // -------------------- Security --------------------
  -    // Will be set by security interceptors
  -
  -    public String getAuthType() ;
  -
  -    public void setAuthType(String authType) ;
  -
  -    String getRemoteUser() ;
  -
  -    void setRemoteUser(String s) ;
  +public class Request {
   
  -    boolean isSecure() ;
  -
  -    // XXX remove - not needed
  -    public void setUserRoles( String roles[] );
  -
  -    public String[] getUserRoles( );
  -
  -    /** If this request is subject to a security constraint.
  -	A better way would be to have a "merge" mechanism to
  -	add all properties to the container ( like in Apache),
  -	but until this is implemented we'll just keep the
  -	fields in request. 
  -     */
  -    public String[] getRequiredRoles( );
  +    protected int serverPort;
  +    protected String remoteAddr;
  +    protected String remoteHost;
  +    protected String localHost;
  +
  +    // Request components represented as MB.
  +    // MB are also used for headers - it allows lazy
  +    // byte->char conversion so we can add the encoding
  +    // that is known only after header parsing. Work in progress.
  +    protected MessageBytes schemeMB=new MessageBytes();
  +    protected MessageBytes methodMB=new MessageBytes();
  +    protected MessageBytes uriMB=new MessageBytes();
  +    protected MessageBytes queryMB=new MessageBytes();
  +    protected MessageBytes protoMB=new MessageBytes();
  +    // uri components
  +    protected MessageBytes contextMB=new MessageBytes();
  +    protected MessageBytes servletPathMB=new MessageBytes();
  +    protected MessageBytes pathInfoMB=new MessageBytes();
  +
  +    // GS, used by the load balancing layer in the Web Servers
  +    // jvmRoute == the name of the JVM inside the plugin.
  +    protected String jvmRoute;
  +
  +    protected Hashtable attributes = new Hashtable();
  +    protected MimeHeaders headers;
  +    protected Vector cookies = new Vector();
  +
  +    // Processed information ( redundant ! )
  +    protected Hashtable parameters = new Hashtable();
  +
  +
  +    protected int contentLength = -1;
  +    protected String contentType = null;
  +    protected String charEncoding = null;
  +    protected String serverName=null;
  +
  +    // auth infor
  +    protected String authType;
  +    boolean notAuthenticated=true;
  +    protected String remoteUser;
  +    protected Principal principal;
  +    // active roles for the current user
  +    protected String userRoles[];
  +    protected String reqRoles[];
  +
  +    // Association with other tomcat comp.
  +    protected Response response;
  +    protected ContextManager contextM;
  +    protected Context context;
  +
  +    protected boolean didReadFormData;
  +    protected boolean didParameters;
  +    protected boolean didCookies;
  +    // end "Request" variables
  +
  +    // @deprecated
  +    protected HttpServletRequest requestFacade;
  +
  +    // Session
  +    // set by interceptors - the session id
  +    protected String reqSessionId;
  +    protected String sessionIdSource;
  +    // cache- avoid calling SessionManager for each getSession()
  +    protected HttpSession serverSession;
  +
  +    protected Handler handler = null;
  +    Container container;
  +
  +    protected ServletInputStream in;
  +
  +    // sub-request support 
  +    Request top;
  +    Request parent;
  +    Request child;
  +
  +    // @deprecated
  +    protected String method;
  +    protected String requestURI;
  +    protected String queryString;
  +    protected String protocol;
  +    protected String servletName;
       
  -    public void setRequiredRoles( String roles[] );
  +    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;
   
  -    /**
  -     */
  -     Principal getUserPrincipal() ;
  -
  -    void setUserPrincipal(Principal p) ;
  -
  -    /**
  -     */
  -    boolean isUserInRole(String role) ;
  -
  -    // -------------------- Session --------------------
  -    // Multiple JVM support
  -    // GS, used by the load balancing layer
  -    public String getJvmRoute();
  -    public void setJvmRoute(String route);
  -
  -    // Will be set by session interceptors
  -    public String getRequestedSessionId() ;
  -
  -    public void setRequestedSessionId(String reqSessionId) ;
  -
       public static final String SESSIONID_FROM_COOKIE="cookie";
       public static final String SESSIONID_FROM_URL="url";
  -
  -    /** Get the source of the session Id.
  -     */
  -    public String getSessionIdSource() ;
  -    
  -    public void setSessionIdSource(String s) ;
  -
  -    public void setSession(HttpSession serverSession) ;
  -
  -    public HttpSession getSession(boolean create) ;
  -
  -    // -------------------- Parameters --------------------
  -    /** Set query string - will be called by forward
  -     */
  -    public String[] getParameterValues(String name) ;
  -
  -    public String getParameter(String name );
  +    public static final int MAX_INCLUDE=10;
       
  -    public Enumeration getParameterNames() ;
  -
  -    // -------------------- Attributes --------------------
  -    public Object getAttribute(String name) ;
  -
  -    public void setAttribute(String name, Object value) ;
  -
  -    public void removeAttribute(String name) ;
   
  -    public Enumeration getAttributeNames() ;
  -
  -    // -------------------- Input --------------------
  -
  -    // XXX review - do we need both reader and IS ?
  -    /** @deprecated
  -     */
  -    public BufferedReader getReader() 	throws IOException;
  -
  -    /** @deprecated
  -     */
  -    public ServletInputStream getInputStream() 	throws IOException;
  -
  -    public  int doRead( byte b[], int off, int len ) throws IOException;
  -    public  int doRead() throws IOException;
  -
  -    // -------------------- Internal methods --------------------
  -    /** Support for "pools"
  -     */
  -    public void recycle() ;
  -
  -    /** One-to-One with Response
  -     */
  -    public Response getResponse() ;
  -
  -    public void setResponse(Response response) ;
  -
  -    /** One-to-One with Facade
  -     */
  -    public HttpServletRequest getFacade() ;
  -
  -    /** Pointer to the server engine - for errors, etc
  -     */
  -    public void setContextManager( ContextManager cm );
  -
  -    public ContextManager getContextManager();
  -
  -    // -------------------- Internal/deprecated--------------------
  -    // Derived from parsing query string and body (for POST)
  +    public Request() {
  + 	headers = new MimeHeaders();
  + 	recycle(); // XXX need better placement-super()
  +    }
  +
  +    /** Called by mapper interceptors after the context
  +	is found or directly by server adapters when
  +	this is known in advance
  +    */
  +    public void setContext(Context context) {
  +	this.context = context;
  +    }
  +
  +    public Context getContext() {
  +	return context;
  +    }
  +
  +    public void setContextManager( ContextManager cm ) {
  +	contextM=cm;
  +    }
  +
  +    public ContextManager getContextManager() {
  +	return contextM;
  +    }
  +
  +    public MessageBytes getSchemeMB() {
  +	return schemeMB;
  +    }
  +
  +    public String getScheme() {
  +        return schemeMB.toString();
  +    }
  +
  +    public void setScheme( String scheme ) {
  +	schemeMB.setString(scheme);
  +    }
  +
  +    public String getMethod() {
  +        return method;
  +    }
  +
  +    public String getRequestURI() {
  +        if( requestURI!=null) return requestURI;
  +	return requestURI;
  +    }
  +
  +    // XXX used by forward
  +    public String getQueryString() {
  +	if( queryString != null ) return queryString;
  +        return queryString;
  +    }
  +
  +    public String getProtocol() {
  +        return protocol;
  +    }
  +
  +    /** Return the server name. If none was set,
  +     *  extract it from the host header.
  +     *
  +     */
  +    public String getServerName() {
  +	if(serverName!=null) return serverName;
  +
  +	String hostHeader = this.getHeader("host");
  +	if (hostHeader != null) {
  +	    int i = hostHeader.indexOf(':');
  +	    if (i > -1) {
  +		hostHeader = hostHeader.substring(0,i);
  +	    }
  +	    serverName=hostHeader;
  +	    return serverName;
  +	}
  +
  +	if( localHost != null ) {
  +	    serverName = localHost;
  +	    return serverName;
  +	}
  +	// default to localhost - and warn
  +	//	log("No server name, defaulting to localhost");
  +	serverName="localhost";
  +	return serverName;
  +    }
  +
  +    /** Virtual host */
  +    public void setServerName(String serverName) {
  +	this.serverName = serverName;
  +    }
  +
  +    public String getLookupPath() {
  +	return lookupPath;
  +    }
  +
  +    public void setLookupPath( String l ) {
  +	lookupPath=l;
  +    }
  +
  +    // XXX optimize for common case ( single params )
  +    public String getParameter(String name ) {
  +	String[] values = getParameterValues(name);
  +        if (values != null) {
  +            return values[0];
  +        } else {
  +	    return null;
  +        }
  +    }
  +
  +    public String[] getParameterValues(String name) {
  +	handleParameters();
  +        return (String[])parameters.get(name);
  +    }
  +
  +    public Enumeration getParameterNames() {
  +	handleParameters();
  +        return parameters.keys();
  +    }
  +
  +    public String getAuthType() {
  +    	return authType;
  +    }
  +
  +    public String getCharacterEncoding() {
  +        if(charEncoding!=null) return charEncoding;
  +        charEncoding = RequestUtil.getCharsetFromContentType( getContentType());
  +	return charEncoding;
  +    }
  +
  +    public int getContentLength() {
  +        if( contentLength > -1 ) return contentLength;
  +
  +	String value=getHeader( "content-length" );
  +	if( value==null) return -1;
  +
  +	contentLength = Integer.parseInt(value);
  +	return contentLength;
  +    }
  +
  +    public String getContentType() {
  +	if(contentType != null) return contentType;
  +	contentType = getHeader("content-type");
  +	if(contentType != null) return contentType;
  +	// can be null!! -
  +	return contentType;
  +    }
  +
  +
  +    /** All adapters that know the PT needs to call this method,
  +	in order to set pathTranslatedIsSet, otherwise tomcat
  +	will try to compute it again
  +    */
  +    public void setPathTranslated(String s ) {
  +	pathTranslated=s;
  +	pathTranslatedIsSet=true;
  +    }
  +
  +    /** Not so usefull - it return the path translated for a
  +	URL relative the the context, i.e. different from
  +	what PATH_TRANSLATED does. Avoid using it.
  +    */
  +    public String getPathTranslated() {
  +	if( pathTranslatedIsSet ) return pathTranslated;
   
  -    // Used in ReqDispatcher
  -    /** @deprecated internal use only */
  -    public void setParameters( Hashtable h ) ;
  -    /** @deprecated internal use only */
  -    public Hashtable getParameters() ;
  +	// not set yet - we'll compute it
  +	pathTranslatedIsSet=true;
  +	String path=getPathInfo();
  +	// In CGI spec, PATH_TRANSLATED shouldn't be set if no path
  +	// info is present
  +	pathTranslated=null;
  +	if(path==null || "".equals( path ) ) return null;
  +	pathTranslated=context.getRealPath( path );
  +	return pathTranslated;
  +    }
  +
  +
  +    // XXX XXX Servlet API conflicts with the CGI specs -
  +    // PathInfo should be "" if no path info is requested ( as it is in CGI ).
  +    // We are following the spec, but IMHO it's a bug ( in the spec )
  +    public String getPathInfo() {
  +        return pathInfo;
  +    }
  +
  +    public void setRemoteUser(String s) {
  +	remoteUser=s;
  +	// this is set by an auth module
  +	// 	context.log("Set user " + s );
  +	notAuthenticated=false;
  +    }
  +
  +    public String getRemoteUser() {
  +	if( notAuthenticated ) {
  +	    notAuthenticated=false;
  +	    contextM.doAuthenticate(this, response);
  +	    // 	    context.log("Auth " + remoteUser );
  +	}
  +	return remoteUser;
  +    }
  +
  +    public boolean isSecure() {
  +	// The adapter is responsible for providing this information
  +        return schemeMB.equalsIgnoreCase("HTTPS");
  +    }
  +
  +    public void setUserPrincipal( Principal p ) {
  +	principal=p;
  +    }
  +
  +    /** Return the principal - the adapter will set it
  +     */
  +    public Principal getUserPrincipal() {
  +	if( getRemoteUser() == null ) return null;
  +	if( principal == null ) {
  +	    principal=new SimplePrincipal( getRemoteUser() );
  +	}
  +	return principal;
  +    }
  +
  +    public void setRequiredRoles( String roles[] ) {
  +	reqRoles=roles;
  +    }
  +
  +    public String[] getRequiredRoles( ) {
  +	return reqRoles;
  +    }
  +
  +    public void setUserRoles( String roles[] ) {
  +	userRoles=roles;
  +    }
  +
  +    public String[] getUserRoles( ) {
  +	return userRoles;
  +    }
  +
  +    public boolean isUserInRole(String role) {
  +	// 	if (userRoles != null) {
  +	// 	    if( SecurityTools.haveRole( role, userRoles ))
  +	// 		return true;
  +	// 	}
  +	String checkRoles[]=new String[1];
  +	checkRoles[0]=role;
  +	int status=contextM.doAuthorize(this, response, checkRoles);
  +	return status==0;
  +    }
  +
  +    public String getServletPath() {
  +        return servletPath;
  +    }
  +
  +    // End hints
  +
  +    // -------------------- Request methods ( high level )
  +    public HttpServletRequest getFacade() {
  +	// some requests are internal, and will never need a
  +	// facade - no need to create a new object unless needed.
  +        if( requestFacade==null ) {
  +	    if( context==null ) {
  +		// wrong request
  +		// XXX the will go away after we remove the one-one relation between
  +		// request and facades ( security, etc)
  +		requestFacade = contextM.getContext("" ).getFacadeManager().createHttpServletRequestFacade(this );
  +		return requestFacade;
  +	    }
  +	    requestFacade = context.getFacadeManager().createHttpServletRequestFacade(this);
  +	}
  +	return requestFacade;
  +    }
  +
  +    public void setResponse(Response response) {
  +	this.response = response;
  +    }
  +
  +    public Response getResponse() {
  +	return response;
  +    }
   
  +    // -------------------- Session --------------------
  +    // GS - return the jvm load balance route
  +    public String getJvmRoute() {
  +	    return jvmRoute;
  +    }
  +
  +    public void setJvmRoute(String jvmRoute) {
  +	    this.jvmRoute=jvmRoute;
  +    }
  +
  +    public String getRequestedSessionId() {
  +        return reqSessionId;
  +    }
  +
  +    public void setRequestedSessionId(String reqSessionId) {
  +	this.reqSessionId = reqSessionId;
  +    }
  +
  +    public String getSessionIdSource() {
  +	return sessionIdSource;
  +    }
  +
  +    public void setSessionIdSource(String s) {
  +	sessionIdSource=s;
  +    }
  +
  +    public void setSession(HttpSession serverSession) {
  +	//	context.log("Request: set session ! ");
  +	this.serverSession = serverSession;
  +    }
  +
  +    public HttpSession getSession(boolean create) {
  +	if( serverSession!=null ) {
  +	    // if not null, it is validated by the session module
  +	    return serverSession;
  +	}
  +
  +	if( ! create ) return null;
  +
  +	//	context.log("Request:  created new session!");
  +	contextM.doNewSessionRequest( this, response );
  +	if ( serverSession == null ) {
  +	    //	    context.log("Request: no session created!");
  +	    return null;
  +	}
  +
  +	reqSessionId = serverSession.getId();
  +	response.setSessionId( reqSessionId );
  +
  +	return serverSession;
  +    }
  +
  +    // --------------------
  +    public int getCookieCount() {
  +	if( ! didCookies ) {
  +	    didCookies=true;
  +	    RequestUtil.processCookies( this, cookies );
  +	}
  +	return cookies.size();
  +    }
  +
  +    public Cookie getCookie( int idx ) {
  +	if( ! didCookies ) {
  +	    didCookies=true;
  +	    RequestUtil.processCookies( this, cookies );
  +	}
  +	return (Cookie)cookies.elementAt(idx);
  +    }
  +
  +    public Cookie[] getCookies() {
  +	int count=getCookieCount();
  +	Cookie[] cookieArray = new Cookie[ count ];
  +
  +	for (int i = 0; i < count; i ++) {
  +	    cookieArray[i] = getCookie( i );
  +	}
  +
  +	return cookieArray;
  +    }
  +    // -------------------- LookupResult
  +    public Handler getWrapper() {
  +	return handler;
  +    }
  +
  +    public void setWrapper(Handler handler) {
  +	this.handler=handler;
  +    }
  +
  +    public Container getContainer() {
  +	return container;
  +    }
  +
  +    public void setContainer(Container container) {
  +	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 setRequestURI( String r ) {
  + 	this.requestURI=r;
  +    }
  +
  +    public void setParameters( Hashtable h ) {
  +	if(h!=null)
  +	    this.parameters=h;
  +	// XXX Should we override query parameters ??
  +    }
  +
  +    public Hashtable getParameters() {
  +	return parameters;
  +    }
  +
  +    public void setContentLength( int  len ) {
  +	this.contentLength=len;
  +    }
  +
  +    public void setContentType( String type ) {
  +	this.contentType=type;
  +    }
  +
  +    public void setCharEncoding( String enc ) {
  +	this.charEncoding=enc;
  +    }
  +
  +    public void setAuthType(String authType) {
  +        this.authType = authType;
  +    }
  +
  +
  +    public void setPathInfo(String pathInfo) {
  +        this.pathInfo = pathInfo;
  +    }
   
  -    /** Wrapper - the servlet that will execute the request
  -     *  Similar with "handler" in Apache.
  -     *  @deprecated - use Container instead
  +    /** Set query string - will be called by forward
        */
  -    public Handler getWrapper() ;
  +    public void setQueryString(String queryString) {
  +	// the query will be processed when getParameter() will be called.
  +	// Or - if you alredy have it parsed, call setParameters()
  +	this.queryString = queryString;
  +    }
  +
  +    public void setServletPath(String servletPath) {
  +	this.servletPath = servletPath;
  +    }
  +
  +
  +    // XXX
  +    // the server name should be pulled from a server object of some
  +    // sort, not just set and got.
  +
  +    // -------------------- Attributes
  +    public Object getAttribute(String name) {
  +        Object value=attributes.get(name);
  +	if( value != null )
  +	    return value;
  +
  +	// allow access to FacadeManager for servlets
  +	// ( this way you don't need to deal with init ).
  +	if( name.equals(FacadeManager.FACADE_ATTRIBUTE)) {
  +	    return context.getAttribute( name );
  +	}
  +	return null;
  +    }
  +
  +    public void setAttribute(String name, Object value) {
  +	if(name!=null && value!=null)
  +	    attributes.put(name, value);
  +    }
  +
  +    public void removeAttribute(String name) {
  +	attributes.remove(name);
  +    }
  +
  +    public Enumeration getAttributeNames() {
  +        return attributes.keys();
  +    }
  +    // End Attributes
   
  -    /**
  -     *  @deprecated - use Container instead
  -     */
  -    public void setWrapper(Handler handler) ;
  +    // -------------------- Sub requests
   
  -    // -------------------- Included requests --------------------
  -    public static final int MAX_INCLUDE=10;
  -    
       /** If this is a sub-request, return the parent
        */
  -    public Request getParent();
  -    
  -    public void setParent( Request req );    
  +    public Request getParent() {
  +	return parent;
  +    }
  +
  +    public void setParent( Request req ) {
  +	parent =req;
  +    }
   
       /** During include, a sub-request will be created.
        *  This represents the current included request
        */
  -    public Request getChild();
  -    
  -    public void setChild( Request req );
  +    public Request getChild() {
  +	return child;
  +    }
  +
  +    public void setChild( Request req ) {
  +	child=req;
  +    }
   
       /** This is the top request ( for a sub-request )
        */
  -    public Request getTop();
  +    public Request getTop() {
  +	if( top == null  ) {
  +	    if( parent==null )
  +		top=this;
  +	    else {
  +		int i=MAX_INCLUDE;
  +		Request p=parent;
  +		while( i-- > 0 && p.getParent()!= null )
  +		    p=p.getParent();
  +		if( i == 0 )
  +		    throw new IllegalStateException("Too deep includes");
  +		top=p;
  +	    }
  +	}
  +	return top;
  +    }
  +
  +    // -------------------- Facade for MimeHeaders
  +    public Enumeration getHeaders(String name) {
  +	//	Vector v = reqA.getMimeHeaders().getHeadersVector(name);
  +	Vector v = getMimeHeaders().getHeadersVector(name);
  +	return v.elements();
  +    }
   
  -    // -------------------- Notes --------------------
  -    /** Add a per/request internal attribute.
  -     *  We keep internal attributes in a separate space to prevent
  -     *  servlets from accessing them. We also use indexed access for
  -     *  speed ( as oposed to hashtable lookups ). Get an Id from ContextManager.
  +    // -------------------- Utils - facade for RequestUtil
  +    /** @deprecated
        */
  -    public void setNote( int pos, Object value );
  -
  -    public Object getNote( int pos );
  +    public BufferedReader getReader()
  +	throws IOException
  +    {
  +	return RequestUtil.getReader( this );
  +    }
  +
  +    private void handleParameters() {
  +   	if(!didParameters) {
  +	    String qString=getQueryString();
  +	    if(qString!=null) {
  +		didParameters=true;
  +		RequestUtil.processFormData( qString, parameters );
  +	    }
  +	}
  +	if (!didReadFormData) {
  +	    didReadFormData = true;
  +	    Hashtable postParameters=RequestUtil.readFormData( this );
  +	    if(postParameters!=null)
  +		parameters = RequestUtil.mergeParameters(parameters, postParameters);
  +	}
  +    }
  +
  +    // -------------------- End utils
  +    public void recycle() {
  +        if( requestFacade != null && context!=null ) {
  +            context.getFacadeManager().recycle(this);
  +        }
  +
  +        context = null;
  +        attributes.clear();
  +        parameters.clear();
  +        cookies.removeAllElements();
  +	//        requestURI = null;
  +	//        queryString = null;
  +        contentLength = -1;
  +        contentType = null;
  +        charEncoding = null;
  +        authType = null;
  +        remoteUser = null;
  +        reqSessionId = null;
  +        serverSession = null;
  +        didParameters = false;
  +        didReadFormData = false;
  +        didCookies = false;
  +        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;
  +        pathTranslated=null;
  +        pathInfo=null;
  +        pathTranslatedIsSet=false;
  +        sessionIdSource = null;
  +
  +        // XXX a request need to override those if it cares
  +        // about security
  +        remoteAddr="127.0.0.1";
  +        remoteHost="localhost";
  +        localHost="localhost";
  +        for( int i=0; i<ACCOUNTS; i++ ) accTable[i]=0;
  +        for( int i=0; i<ContextManager.MAX_NOTES; i++ ) notes[i]=null;
  +	parent=null;
  +	child=null;
  +	top=null;
  +        notAuthenticated=true;
  +	userRoles=null;
  +	reqRoles=null;
  +	in=null;
  +
  +	uriMB.recycle();
  +	contextMB.recycle();
  +	pathInfoMB.recycle();
  +	servletPathMB.recycle();
  +	queryMB.recycle();
  +	methodMB.recycle();
  +	protoMB.recycle();
  +        schemeMB.setString("http");
  +
  +    }
  +
  +    public MimeHeaders getMimeHeaders() {
  +	return headers;
  +    }
  +
  +    public String getHeader(String name) {
  +        return headers.getHeader(name);
  +    }
  +
  +    public Enumeration getHeaderNames() {
  +        return headers.names();
  +    }
  +
  +    public ServletInputStream getInputStream() throws IOException {
  +	// will be removed from here
  +	return getFacade().getInputStream();
  +	// 	if( in==null ) {
  +	// 	    in=new BufferedServletInputStream( this );
  +	// 	    ((BufferedServletInputStream)in).initLimit();
  +	// 	}
  +	//     	return in;
  +    }
  +
  +    public int getServerPort() {
  +        return serverPort;
  +    }
  +
  +    public String getRemoteAddr() {
  +        return remoteAddr;
  +    }
  +
  +    public String getRemoteHost() {
  +	return remoteHost;
  +    }
  +
  +    /** Fill in the buffer. This method is probably easier to implement than
  +	previous.
  +	This method should only be called from SerlvetInputStream implementations.
  +	No need to implement it if your adapter implements ServletInputStream.
  +     */
  +    // you need to override this method if you want non-empty InputStream
  +    public  int doRead( byte b[], int off, int len ) throws IOException {
  +	return -1; // not implemented - implement getInputStream
  +    }
  +
  +
  +    // XXX I hate this - but the only way to remove this method from the
  +    // inteface is to implement it on top of doRead(b[]).
  +    // Don't use this method if you can ( it is bad for performance !!)
  +    // you need to override this method if you want non-empty InputStream
  +    public int doRead() throws IOException {
  +	return -1;
  +    }
  +
  +    // -------------------- "cooked" info --------------------
  +    // Hints = return null if you don't know,
  +    // and Tom will find the value. You can also use the static
  +    // methods in Request
  +
  +    // What's between context path and servlet name ( /servlet )
  +    // A smart server may use arbitrary prefixes and rewriting
  +    public String getServletPrefix() {
  +	return null;
  +    }
  +
  +    public void setMethod( String method ) {
  +	this.method=method;
  +    }
  +
  +    public void setProtocol( String protocol ) {
  +	this.protocol=protocol;
  +    }
  +
  +    public void setMimeHeaders( MimeHeaders headers ) {
  +	this.headers=headers;
  +    }
  +
  +    public void setServerPort(int serverPort ) {
  +	this.serverPort=serverPort;
  +    }
  +
  +    public void setRemoteAddr( String remoteAddr ) {
  +	this.remoteAddr=remoteAddr;
  +    }
  +
  +    public void setRemoteHost(String remoteHost) {
  +	this.remoteHost=remoteHost;
  +    }
  +
  +    public String getLocalHost() {
  +	return localHost;
  +    }
  +
  +    public void setLocalHost(String host) {
  +	this.localHost = host;
  +    }
  +
  +
  +    public String toString() {
  +	StringBuffer sb=new StringBuffer();
  +	sb.append( "R( ");
  +	if( context!=null) {
  +	    sb.append( context.getPath() );
  +	    if( getServletPath() != null )
  +		sb.append( " + " + getServletPath() + " + " + getPathInfo());
  +	    else
  +		sb.append( " + " + getLookupPath());
  +	} else {
  +	    sb.append(getRequestURI());
  +	}
  +	sb.append(")");
  +	return sb.toString();
  +    }
  +
  +    // -------------------- Accounting --------------------
  +    // XXX Will be implemented as a note !
  +    public static final int ACC_PRE_CMAP=0;
  +    public static final int ACC_PRE_RMAP=1;
  +    public static final int ACC_POST_MAP=2;
  +    public static final int ACC_PRE_SERVICE=3;
  +    public static final int ACC_POST_SERVICE=4;
  +    public static final int ACC_IN_OUT=5;
  +    public static final int ACC_OUT_COUNT=6;
  +
  +    public static final int ACCOUNTS=7;
  +    long accTable[]=new long[ACCOUNTS];
  +
  +    public void setAccount( int pos, long value ) {
  +	accTable[pos]=value;
  +    }
  +
  +    public long getAccount( int pos ) {
  +	return accTable[pos];
  +    }
  +
  +    // -------------------- Per-Request "notes"
  +    Object notes[]=new Object[ContextManager.MAX_NOTES];
  +
  +    public void setNote( int pos, Object value ) {
  +	notes[pos]=value;
  +    }
  +
  +    public Object getNote( int pos ) {
  +	return notes[pos];
  +    }
   
  -	
   }
  
  
  
  1.27      +587 -130  jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java
  
  Index: Response.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Response.java	2000/08/11 21:20:03	1.26
  +++ Response.java	2000/08/12 04:55:46	1.27
  @@ -1,4 +1,8 @@
   /*
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Response.java,v 1.27 2000/08/12 04:55:46 costin Exp $
  + * $Revision: 1.27 $
  + * $Date: 2000/08/12 04:55:46 $
  + *
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
  @@ -66,6 +70,8 @@
   import javax.servlet.*;
   import javax.servlet.http.*;
   import org.apache.tomcat.util.*;
  +import org.apache.tomcat.facade.*;
  +import org.apache.tomcat.logging.*;
   
   /**
    *
  @@ -74,158 +80,609 @@
    * @author James Todd [gonzo@eng.sun.com]
    * @author Harish Prabandham
    * @author Hans Bergsten <hans@gefionsoftware.com>
  - * @author costin@dnt.ro
    */
  -public interface Response {
  -    // -------------------- Headers -------------------- 
  -    public boolean containsHeader(String name) ;
  -
  -    public MimeHeaders getMimeHeaders();
  +public class Response {
  +    protected static StringManager sm =
  +        StringManager.getManager("org.apache.tomcat.resources");
  +    static final Locale DEFAULT_LOCALE=new Locale(Constants.LOCALE_DEFAULT, "");
  +
  +    protected Request request;
  +    protected HttpServletResponse responseFacade;
  +
  +    protected Vector userCookies = new Vector();
  +    protected String contentType = Constants.DEFAULT_CONTENT_TYPE;
  +    protected String contentLanguage = null;
  +    protected String characterEncoding = Constants.DEFAULT_CHAR_ENCODING;
  +    protected String sessionId;
  +    protected int contentLength = -1;
  +    protected int status = 200;
  +    private Locale locale = DEFAULT_LOCALE;
  +
  +    protected MimeHeaders headers = new MimeHeaders();
  +
  +    // When getWriter is called on facade, both sos and writer are
  +    // set.
  +    // usingStream== ( sos!=null && writer ==null)
  +    // usingWriter== ( writer != null )
  +    // started == ( sos!=null )
  +    //    protected ServletOutputStream sos;
  +    protected PrintWriter writer;
  +
  +    protected boolean commited = false;
  +
  +    //    protected ByteBuffer bBuffer;
  +    protected OutputBuffer oBuffer;
  +
  +    // @deprecated
  +    protected boolean usingStream = false;
  +    protected boolean usingWriter = false;
  +    protected boolean started = false;
       
  -    public void setHeader(String name, String value) ;
  -
  -    public void addHeader(String name, String value) ;
  -
  -    /** Signal that we're done with the headers, and body will follow.
  -     *  Any implementation needs to notify ContextManager, to allow
  -     *  interceptors to fix headers.
  -     */
  -    public void endHeaders() throws IOException;
  +    boolean notIncluded=true;
   
  -    // -------------------- Output method --------------------
  -    /** True if getOutputStream or getWriter was called.
  -     *  XXX change it to "if any output was writen"
  -     *
  -     *  Used by RD.forward() and ServletWrapper.error()
  -     */
  -    public boolean isStarted() ;
  -
  -//     /** True if getOutputStream was called.
  -//      *  Used to avoid the ugly try getWriter() catch getOutputStream.
  -//      */
  -//     public boolean isUsingStream();
  -
  -//     /** The output stream is used.
  -//      */
  -//     public void setUsingStream( boolean stream );
  -
  -//     /** Stream/Writer control
  -//      */
  -//     public boolean isUsingWriter();
  -
  -//     /** Stream/Writer control
  -//      */
  -//     public void setUsingWriter( boolean writer );
  -
  +    // default implementation will just append everything here
  +    StringBuffer body=null;
       
  -    /** Signal that we're done with a particular request, the
  -     *	server can go on and read more requests or close the socket
  -     */
  -    public void finish() throws IOException ;
  -
  -    /** Either re-implement getOutputStream or return BufferedServletOutputStream(this)
  -     *  and implement doWrite();
  -     */
  -//     public ServletOutputStream getOutputStream() throws IOException;
  -
  -    //    public void setServletOutputStream(ServletOutputStream s );
  -//     public void setWriter( PrintWriter w );
  +    public Response() {
  +	// 	if( useBuffer ) {
  +	// 	    bBuffer=new ByteBuffer();
  +	// 	    bBuffer.setParent( this );
  +	// 	    out=null;
  +	// 	} else {
  +	// 	    out=new BufferedServletOutputStream();
  +	// 	    out.setResponse( this );
  +	// 	}
  +    }
  +
  +    void init() {
  +	// init must be called from CM - we need req, etc.
  +	oBuffer=new OutputBuffer( this );
  +    }
       
  -    public void doWrite( byte buffer[], int pos, int count) throws IOException;
  +    public HttpServletResponse getFacade() {
  +        if( responseFacade==null ) {
  +	    Context ctx= request.getContext();
  +	    if( ctx == null ) {
  +		ctx=request.getContextManager().getContext("");
  +	    }
  +	    responseFacade = ctx.getFacadeManager().createHttpServletResponseFacade(this);
  +	}
  +	return responseFacade;
  +    }
  +
  +    public void setRequest(Request request) {
  +	this.request = request;
  +    }
  +
  +    public Request getRequest() {
  +	return request;
  +    }
  +
  +    /* -------------------- */
  +
  +    // Included response behavior
  +    public boolean isIncluded() {
  +	return ! notIncluded;
  +    }
  +
  +    public void setIncluded( boolean incl ) {
  +	notIncluded= ! incl;
  +	if( incl ) {
  +	    // included behavior, no header output,
  +	    // no status change on errors.
  +	    // XXX we can optimize a bit - replace headers with
  +	    // an new Hashtable we can throw away. 
  +	} else {
  +	    // move back to normal behavior.
  +
  +	}
  +    }
  +
  +    /** If the writer/output stream was requested
  +     */
  +    public boolean isStarted() {
  +	return started;
  +    }
       
  -//     public PrintWriter getWriter() throws IOException ;
  -
  -    /** True if we are in an included servlet
  -     */
  -    public boolean isIncluded();
  -
  -    /** The response will not set any header or the status line -
  -     *  it can only write to the output stream or flush.
  -     *  This is used to implement RD.include() and can be used for
  -     *  HTTP/0.9
  -     */
  -    public void setIncluded(boolean b);
  +    public void recycle() {
  +	userCookies.removeAllElements(); // XXX reuse !!!
  +	contentType = Constants.DEFAULT_CONTENT_TYPE;
  +	contentLanguage = null;
  +        locale = DEFAULT_LOCALE;
  +	characterEncoding = Constants.DEFAULT_CHAR_ENCODING;
  +	contentLength = -1;
  +	status = 200;
  +	usingWriter = false;
  +	usingStream = false;
  +	sessionId=null;
  +	writer=null;
  +	//	sos=null;
  +	started = false;
  +	commited = false;
  +	notIncluded=true;
  +	// adapter
  +	body=null;
  +	// 	if( out != null ) out.recycle();
  +	// 	if( bBuffer != null ) bBuffer.recycle();
  +	oBuffer.recycle();
  +	headers.clear();
  +    }
  +
  +    public void finish() throws IOException {
  +	// 	if (usingWriter && (writer != null)) {
  +	// 	    writer.flush();
  +	// 	    writer.close();
  +	// 	}
  +	oBuffer.flushChars();
  +	oBuffer.flushBytes();
  +
  +	// 	if( bBuffer != null) {
  +	// 	    bBuffer.flush();
  +	// 	    request.getContextManager().doAfterBody(request, this);
  +	// 	    return;
  +	// 	}
   	
  +	// 	out.flush();
  +	// 	out.reallyFlush();
  +	
  +	request.getContextManager().doAfterBody(request, this);
  +	//	out.close();
  +    }
  +
  +    public boolean containsHeader(String name) {
  +	return headers.containsHeader(name);
  +    }
  +
  +    // XXX
  +    // mark whether or not we are being used as a stream our writer
  +
  +    public boolean isUsingStream() {
  +	return usingStream;
  +    }
  +
  +    public void setUsingStream( boolean stream ) {
  +	usingStream=stream;
  +    }
       
  -    // -------------------- Buffering --------------------
  +    public boolean isUsingWriter() {
  +	return usingWriter;
  +    }
  +
  +    public void setUsingWriter( boolean writer ) {
  +	usingWriter=writer;
  +	//	if( out!=null ) out.setUsingWriter(true);
  +    }
  +
  +//     public void setWriter( PrintWriter w ) {
  +// 	this.writer=w;
  +//     }
       
  -    public int getBufferSize() ;
  -
  -    public void setBufferSize(int size) throws IllegalStateException ;
  -
  -    public boolean isBufferCommitted() ;
  -
  -    public void setBufferCommitted(boolean v) ;
  -
  -    public void reset() throws IllegalStateException ;
  -
  -    // Reset the response buffer but not headers and cookies
  -    public void resetBuffer() throws IllegalStateException ;
  -
  -    /** Any implementation needs to notify ContextManger
  -     */
  -    public void flushBuffer() throws IOException ;
  -
  -    // -------------------- Cookies --------------------
  -
  -    public void addCookie(Cookie cookie) ;
  -
  -    public Enumeration getCookies();
  +//     public PrintWriter getWriter() throws IOException {
  +// 	// usingWriter
  +// 	if( writer != null )
  +// 	    return writer;
  +
  +// 	sos=getFacade().getOutputStream();
  +	    
  +// 	writer=getWriter( sos );
  +
  +// 	return writer;
  +   
  +// 	// 	if( out !=null )
  +// 	// 	    return getWriter( out );
  +	
  +// 	// it will know what to do. This method is here
  +// 	// just to keep old code happy ( internal error handlers)
  +// 	//if( usingStream ) {
  +// 	//    return getWriter( getFacade().getOutputStream());
  +// 	//}
  +// 	//return getFacade().getWriter();
  +//     }
   
  -    // -------------------- Response properties --------------------
  -    // Note: headers are not set when you invoke the methods, but
  -    // later, when final fixHeaders happens ( before sending the body )
  +//     public PrintWriter getWriter(ServletOutputStream outs) throws IOException {
  +	
  +// 	if(writer!=null) return writer;
  +// 	// it already did all the checkings
  +	
  +// 	started = true;
  +// 	usingWriter = true;
  +	
  +// 	//	writer = new ServletWriterFacade( getConverter(outs), this);
  +// 	writer = new ServletWriterFacade( oBuffer, this);
  +// 	return writer;
  +//     }
  +
  +//     public Writer getConverter( ServletOutputStream outs ) throws IOException {
  +// 	String encoding = getCharacterEncoding();
  +
  +// 	if (encoding == null) {
  +// 	    // use default platform encoding - is this correct ? 
  +// 	    return  new OutputStreamWriter(outs);
  +//         }  else {
  +// 	    try {
  +// 		return  new OutputStreamWriter(outs, encoding);
  +// 	    } catch (java.io.UnsupportedEncodingException ex) {
  +// 		log("Unsuported encoding: " + encoding, Logger.ERROR );
  +
  +// 		return new OutputStreamWriter(outs);
  +// 	    }
  +// 	}
  +//     }
  +
  +    public OutputBuffer getBuffer() {
  +	return oBuffer;
  +    }
       
  -    public Locale getLocale() ;
  -
  -    public void setLocale(Locale locale) ;
  -
  -    /**  translate locale into encoding. 
  -     */
  -    public String getCharacterEncoding() ;
  -
  -    /** Set content type - this might also set encoding, if specified
  -     */
  -    public void setContentType(String contentType) ;
  -
  -    public String getContentType();
  -
  -    public void setContentLength(int contentLength) ;
  -
  -    public int getContentLength() ;
  -
  -    public void setStatus(int status);
  -
  -    public int getStatus() ;
  +//     public ByteBuffer getOutputBuffer() {
  +// 	started=true;
  +// 	return bBuffer;
  +//     }
  +
  +//     public void setOutputBuffer(ByteBuffer buf) {
  +// 	bBuffer=buf;
  +// 	if( buf!= null) buf.setParent( this );
  +//     }
  +    
  +    /** Either implement ServletOutputStream or return BufferedServletOutputStream(this)
  +	and implement doWrite();
  +	@deprecated 
  +     */
  +//     public ServletOutputStream getOutputStream() throws IOException {
  +// 	started = true;
  +// // 	if( out!=null)
  +// // 	    return out;
  +// 	// neither writer or output stream used
  +// 	if( sos == null )
  +// 	    sos=getFacade().getOutputStream();
  +
  +// 	return sos;
  +//     }
  +
  +//     public void setServletOutputStream( ServletOutputStream s ) {
  +// 	sos=s;
  +//     }
  +
  +    // -------------------- Headers --------------------
  +    public MimeHeaders getMimeHeaders() {
  +	return headers;
  +    }
  +
  +
  +    public void setHeader(String name, String value) {
  +	if( ! notIncluded ) return; // we are in included sub-request
  +	char cc=name.charAt(0);
  +	if( cc=='C' || cc=='c' ) {
  +	    if( checkSpecialHeader(name, value) )
  +		return;
  +	}
  +	headers.putHeader(name, value);
  +    }
  +
  +    public void addHeader(String name, String value) {
  +	if( ! notIncluded ) return; // we are in included sub-request
  +	char cc=name.charAt(0);
  +	if( cc=='C' || cc=='c' ) {
  +	    if( checkSpecialHeader(name, value) )
  +		return;
  +	}
  +	headers.addHeader(name, value);
  +    }
   
  -    /** Will set the session id. The session interceptor might
  -     *  process it and add a Cookie header, and it can be used to
  -     *  rewrite URLs.
  -     *  This replace "system cookies" ( it was the only use for them )
  +    
  +    /** Set internal fields for special header names. Called from set/addHeader.
  +	Return true if the header is special, no need to set the header.
        */
  -    public void setSessionId(String sId );
  +    private boolean checkSpecialHeader( String name, String value) {
  +	// XXX Eliminate redundant fields !!!
  +	// ( both header and in special fields )
  +	if( name.equalsIgnoreCase( "Content-Type" ) ) {
  +	    setContentType( value );
  +	    return true;
  +	}
  +	if( name.equalsIgnoreCase( "Content-Length" ) ) {
  +	    try {
  +		int cL=Integer.parseInt( value );
  +		setContentLength( cL );
  +		return true;
  +	    } catch( NumberFormatException ex ) {
  +		// We shouldn't set the header
  +		log("Bogus Content-Length: " + value, Logger.WARNING);
  +	    }
  +	}
  +	if( name.equalsIgnoreCase( "Content-Language" ) ) {
  +	    // XXX XXX Need to construct Locale or something else
  +	}
  +	return false;
  +    }
  +
  +    public int getBufferSize() {
  +	// 	if( out!=null ) return out.getBufferSize();
  +	// 	if( bBuffer != null ) return bBuffer.getBufferSize();
  +	return oBuffer.getBufferSize();
  +    }
  +
  +    public void setBufferSize(int size) throws IllegalStateException {
  +	// Force the PrintWriter to flush the data to the OutputStream.
  +	if (usingWriter == true && writer != null ) writer.flush();
  +
  +	if( oBuffer.getBytesWritten() >0  ) {
  +	    throw new IllegalStateException ( sm.getString("servletOutputStreamImpl.setbuffer.ise"));
  +	}
  +	oBuffer.setBufferSize( size );
  +	// 	if( bBuffer != null ) {
  +	// 	    if( bBuffer.getBytesWritten() >0  ) {
  +	// 		throw new IllegalStateException ( sm.getString("servletOutputStreamImpl.setbuffer.ise"));
  +	// 	    }
  +	// 	    bBuffer.setBufferSize(size);
  +	// 	    return;
  +	// 	}
  +	
  +	// 	if (out.isContentWritten()  ) {
  +	// 	    throw new IllegalStateException ( sm.getString("servletOutputStreamImpl.setbuffer.ise"));
  +	// 	}
  +	// 	out.setBufferSize(size);
  +    }
  +
  +    /*
  +     * Methodname "isCommitted" already taken by Response class.
  +     */
  +    public boolean isBufferCommitted() {
  +	return commited;
  +	//	return out.isCommitted();
  +    }
  +
  +    public void setBufferCommitted( boolean v ) {
  +	this.commited=v;
  +    }
       
  -    public String getSessionId( );
  +    public void reset() throws IllegalStateException {
  +	// Force the PrintWriter to flush its data to the output
  +        // stream before resetting the output stream
  +        //
  +	userCookies.removeAllElements();  // keep system (session) cookies
  +	contentType = Constants.DEFAULT_CONTENT_TYPE;
  +        locale = DEFAULT_LOCALE;
  +	characterEncoding = Constants.DEFAULT_CHAR_ENCODING;
  +	contentLength = -1;
  +	status = 200;
  +
  +	if (usingWriter == true && writer != null)
  +	    writer.flush();
  +
  +	body=null;
  +	// Reset the stream
  +	if( commited ) {
  +	    String msg = sm.getString("servletOutputStreamImpl.reset.ise"); 
  +	    throw new IllegalStateException(msg);
  +	}
  +	oBuffer.reset();
  +	// 	if (bBuffer!=null ) bBuffer.reset();
  +	// 	if( out!=null ) out.reset();
  +
  +        // Clear the cookies and such
  +
  +        // Clear the headers
  +        if( notIncluded) headers.clear();
  +    }
   
  -    // -------------------- Buffers --------------------
  +    // Reset the response buffer but not headers and cookies
  +    public void resetBuffer() throws IllegalStateException {
  +	if( usingWriter && writer != null )
  +	    writer.flush();
  +
  +	if( commited ) {
  +	    String msg = sm.getString("servletOutputStreamImpl.reset.ise"); 
  +	    throw new IllegalStateException(msg);
  +	}
  +	oBuffer.reset();
  +	// 	if (bBuffer!=null ) bBuffer.reset();
  +	// 	if( out!=null ) out.reset();	// May throw IllegalStateException
  +
  +    }
  +
  +    public void flushBuffer() throws IOException {
  +	//	if( notIncluded) {
  +	// 	if (usingWriter == true && writer != null)
  +	// 	    writer.flush();
  +
  +	oBuffer.flushChars();
  +	oBuffer.flushBytes();
  +	// 	if( out!=null ) out.reallyFlush();
  +	// 	if(bBuffer!=null) bBuffer.flush();
  +	    //} 
  +    }
   
  -    public OutputBuffer getBuffer();
   
  -    // -------------------- Internal methods --------------------
  -    /** One-to-one with Facade.
  -     *  You can use HttpResponseFacade.
  +    /** Signal that we're done with the headers, and body will follow.
  +     *  Any implementation needs to notify ContextManager, to allow
  +     *  interceptors to fix headers.
        */
  -    public HttpServletResponse getFacade() ;
  +    public void endHeaders() throws IOException {
  +	notifyEndHeaders();
  +    }
   
  -    /** One-to-one relation with Request
  +    /** Signal that we're done with the headers, and body will follow.
  +     *  Any implementation needs to notify ContextManager, to allow
  +     *  interceptors to fix headers.
        */
  -    public void setRequest(Request request) ;
  +    public void notifyEndHeaders() throws IOException {
  +	commited=true;
  +	//	log("End headers " + request.getProtocol());
  +	if(request.getProtocol()==null) // HTTP/0.9 
  +	    return;
  +
  +	// let CM notify interceptors and give a chance to fix
  +	// the headers
  +	if(request.getContext() != null && notIncluded ) 
  +	    request.getContext().getContextManager().doBeforeBody(request, this);
  +
  +	// No action.. 
  +    }
  +
  +    public void addCookie(Cookie cookie) {
  +	addHeader( CookieTools.getCookieHeaderName(cookie),
  +			    CookieTools.getCookieHeaderValue(cookie));
  +	if( cookie.getVersion() == 1 ) {
  +	    // add a version 0 header too.
  +	    // XXX what if the user set both headers??
  +	    Cookie c0 = (Cookie)cookie.clone();
  +	    c0.setVersion(0);
  +	    addHeader( CookieTools.getCookieHeaderName(c0),
  +				CookieTools.getCookieHeaderValue(c0));
  +	}
  +	if( notIncluded ) userCookies.addElement(cookie);
  +    }
  +
  +    public Enumeration getCookies() {
  +	return userCookies.elements();
  +    }
  +
  +    public void setSessionId( String id ) {
  +	if( notIncluded ) sessionId=id;
  +    }
  +
  +    public String getSessionId() {
  +	return sessionId;
  +    }
       
  -    public Request getRequest() ;
  +    public Locale getLocale() {
  +        return locale;
  +    }
  +
  +    public void setLocale(Locale locale) {
  +        if (locale == null || ! notIncluded) {
  +            return;  // throw an exception?
  +        }
  +
  +        // Save the locale for use by getLocale()
  +        this.locale = locale;
  +
  +        // Set the contentLanguage for header output
  +        contentLanguage = locale.getLanguage();
  +
  +        // Set the contentType for header output
  +        // Use the setContentType() method so encoding is set properly
  +        String newType = constructLocalizedContentType(contentType, locale);
  +        setContentType(newType);
  +
  +	// only one header !
  +	headers.putHeader("Content-Language", contentLanguage);
  +    }
  +
  +    /** Utility method for parsing the mime type and setting
  +     *  the encoding to locale. Also, convert from java Locale to mime encodings
  +    */
  +    private static String constructLocalizedContentType(String type, Locale loc) {
  +        // Cut off everything after the semicolon
  +        int semi = type.indexOf(";");
  +        if (semi != -1) {
  +            type = type.substring(0, semi);
  +        }
  +
  +        // Append the appropriate charset, based on the locale
  +        String charset = LocaleToCharsetMap.getCharset(loc);
  +        if (charset != null) {
  +            type = type + "; charset=" + charset;
  +        }
  +
  +        return type;
  +    }
  +
  +    public String getCharacterEncoding() {
  +	return characterEncoding;
  +    }
  +
  +    public void setContentType(String contentType) {
  +        if( ! notIncluded ) return;
  +	this.contentType = contentType;
  +	String encoding = RequestUtil.getCharsetFromContentType(contentType);
  +        if (encoding != null) {
  +	    characterEncoding = encoding;
  +        }
  +	headers.putHeader("Content-Type", contentType);
  +    }
  +
  +    public String getContentType() {
  +	return contentType;
  +    }
  +    
  +    public void setContentLength(int contentLength) {
  +        if( ! notIncluded ) return;
  +	this.contentLength = contentLength;
  +	headers.putHeader("Content-Length", (new Integer(contentLength)).toString());
  +    }
  +
  +    public int getContentLength() {
  +	return contentLength;
  +    }
  +
  +    public int getStatus() {
  +        return status;
  +    }
   
  -    /** Response objects will be pool-able
  -     */
  -    public void recycle() ;
  +    
  +    /** Set the response status 
  +     */ 
  +    public void setStatus( int status ) {
  +	if( ! notIncluded ) return;
  +	this.status=status;
  +    }
  +
  +    /** Write a chunk of bytes. Should be called only from ServletOutputStream implementations,
  +     *	No need to implement it if your adapter implements ServletOutputStream.
  +     *  Headers and status will be written before this method is exceuted.
  +     */
  +    public void doWrite( byte buffer[], int pos, int count) throws IOException {
  +        // XXX fix if charset is other than default.
  +        if( body==null)
  +	    body=new StringBuffer();
  +	body.append(new String(buffer, pos, count, 
  +			       Constants.DEFAULT_CHAR_ENCODING) );
  +    }
  +
  +    public StringBuffer getBody() {
  +	return body;
  +    }
  +
  +    static String st_200=null;
  +    static String st_302=null;
  +    static String st_400=null;
  +    static String st_404=null;
  +    
  +    // utility method - should be in a different class
  +    public static String getMessage( int status ) {
  +	// hotspot, the whole thing must be rewritten.
  +	// Does HTTP requires/allow international messages or
  +	// are pre-defined? The user doesn't see them most of the time
  +	switch( status ) {
  +	case 200:
  +	    if( st_200==null ) st_200=sm.getString( "sc.200");
  +	    return st_200;
  +	case 302:
  +	    if( st_302==null ) st_302=sm.getString( "sc.302");
  +	    return st_302;
  +	case 400:
  +	    if( st_400==null ) st_400=sm.getString( "sc.400");
  +	    return st_400;
  +	case 404:
  +	    if( st_404==null ) st_404=sm.getString( "sc.404");
  +	    return st_404;
  +	}
  +	return sm.getString("sc."+ status);
  +    }
   
  +    // write log messages to correct log
  +    
  +    Logger.Helper loghelper = new Logger.Helper("tc_log", this);
  +    
  +    protected void log(String s) {
  +	log(s, Logger.INFORMATION);
  +    }
  +    protected void log(String s, int level) {
  +	if (request != null && request.getContext() != null) {
  +	    loghelper.setLogger(request.getContext().getLoggerHelper().getLogger());
  +	}
  +	loghelper.log(s, level);
  +    }		       
   
   }
  
  
  
  1.3       +16 -16    jakarta-tomcat/src/share/org/apache/tomcat/request/AccountingInterceptor.java
  
  Index: AccountingInterceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/request/AccountingInterceptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- AccountingInterceptor.java	2000/06/23 02:16:21	1.2
  +++ AccountingInterceptor.java	2000/08/12 04:55:46	1.3
  @@ -104,22 +104,22 @@
   
   
       public int requestMap(Request request ) {
  -	if( acc && request instanceof RequestImpl ) {
  -	    ((RequestImpl)request).setAccount( RequestImpl.ACC_PRE_RMAP, System.currentTimeMillis() );
  +	if( acc ) {
  +	    request.setAccount( Request.ACC_PRE_RMAP, System.currentTimeMillis() );
   	}
   	return 0;
       }
   
       public int contextMap( Request request ) {
  -	if( acc && request instanceof RequestImpl ) {
  -	    ((RequestImpl)request).setAccount( RequestImpl.ACC_PRE_CMAP, System.currentTimeMillis() );
  +	if( acc ) {
  +	    request.setAccount( Request.ACC_PRE_CMAP, System.currentTimeMillis() );
   	}
   	return 0;
       }
   
       public int authenticate(Request request, Response response) {
  -	if( acc && request instanceof RequestImpl ) {
  -	    ((RequestImpl)request).setAccount( RequestImpl.ACC_POST_MAP, System.currentTimeMillis() );
  +	if( acc  ) {
  +	    request.setAccount( Request.ACC_POST_MAP, System.currentTimeMillis() );
   	}
   	return 0;
       }
  @@ -130,8 +130,8 @@
   
   
       public int preService(Request request, Response response) {
  -	if( acc && request instanceof RequestImpl ) {
  -	    ((RequestImpl)request).setAccount( RequestImpl.ACC_PRE_SERVICE, System.currentTimeMillis() );
  +	if( acc ) {
  +	    request.setAccount( Request.ACC_PRE_SERVICE, System.currentTimeMillis() );
   	}
   	return 0;
       }
  @@ -150,21 +150,21 @@
       }
   
       public int postService(Request request, Response response) {
  -	if( acc && request instanceof RequestImpl ) {
  -	    ((RequestImpl)request).setAccount( RequestImpl.ACC_POST_SERVICE, System.currentTimeMillis() );
  +	if( acc  ) {
  +	    request.setAccount( Request.ACC_POST_SERVICE, System.currentTimeMillis() );
   
  -	    long t1=((RequestImpl)request).getAccount( RequestImpl.ACC_PRE_CMAP );
  -	    long t2=((RequestImpl)request).getAccount( RequestImpl.ACC_PRE_RMAP );
  -	    long t3=((RequestImpl)request).getAccount( RequestImpl.ACC_POST_MAP );
  -	    long t4=((RequestImpl)request).getAccount( RequestImpl.ACC_PRE_SERVICE );
  -	    long t5=((RequestImpl)request).getAccount( RequestImpl.ACC_POST_SERVICE );
  +	    long t1=request.getAccount( Request.ACC_PRE_CMAP );
  +	    long t2=request.getAccount( Request.ACC_PRE_RMAP );
  +	    long t3=request.getAccount( Request.ACC_POST_MAP );
  +	    long t4=request.getAccount( Request.ACC_PRE_SERVICE );
  +	    long t5=request.getAccount( Request.ACC_POST_SERVICE );
   
   	    long t21=t2-t1;
   	    long t31=t3-t1;
   	    long t54=t5-t4;
   	    long t41=t4-t1;
   
  -	    long tout=((RequestImpl)request).getAccount( RequestImpl.ACC_OUT_COUNT );
  +	    long tout=request.getAccount( Request.ACC_OUT_COUNT );
   	    StringBuffer sb=new StringBuffer();
   	    // ContextMap, Map, Service, Pre-Service-Overhead
   	    sb.append(t21).append(",");
  
  
  
  1.33      +1 -1      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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Ajp12ConnectionHandler.java	2000/08/11 21:20:31	1.32
  +++ Ajp12ConnectionHandler.java	2000/08/12 04:55:47	1.33
  @@ -172,7 +172,7 @@
       
   }
   
  -class AJP12RequestAdapter extends RequestImpl {
  +class AJP12RequestAdapter extends Request {
       static StringManager sm = StringManager.getManager("org.apache.tomcat.resources");
       Socket socket;
       InputStream sin;
  
  
  
  1.9       +4 -4      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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Ajp13ConnectorRequest.java	2000/08/11 06:14:13	1.8
  +++ Ajp13ConnectorRequest.java	2000/08/12 04:55:47	1.9
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v 1.8 2000/08/11 06:14:13 costin Exp $
  - * $Revision: 1.8 $
  - * $Date: 2000/08/11 06:14:13 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorRequest.java,v 1.9 2000/08/12 04:55:47 costin Exp $
  + * $Revision: 1.9 $
  + * $Date: 2000/08/12 04:55:47 $
    *
    * ====================================================================
    *
  @@ -71,7 +71,7 @@
   import javax.servlet.*;
   import javax.servlet.http.*;
   
  -public class Ajp13ConnectorRequest extends RequestImpl 
  +public class Ajp13ConnectorRequest extends Request 
   {
   	public static final int  MAX_READ_SIZE = TcpConnector.MAX_PACKET_SIZE - 
   	                                         TcpConnector.H_SIZE - 
  
  
  
  1.6       +4 -4      jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorResponse.java
  
  Index: Ajp13ConnectorResponse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorResponse.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Ajp13ConnectorResponse.java	2000/07/18 18:42:46	1.5
  +++ Ajp13ConnectorResponse.java	2000/08/12 04:55:47	1.6
  @@ -1,8 +1,8 @@
   
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorResponse.java,v 1.5 2000/07/18 18:42:46 craigmcc Exp $
  - * $Revision: 1.5 $
  - * $Date: 2000/07/18 18:42:46 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/Ajp13ConnectorResponse.java,v 1.6 2000/08/12 04:55:47 costin Exp $
  + * $Revision: 1.6 $
  + * $Date: 2000/08/12 04:55:47 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
   import javax.servlet.http.*;
   
   
  -public class Ajp13ConnectorResponse extends ResponseImpl 
  +public class Ajp13ConnectorResponse extends Response 
   {
   	public static final int  MAX_SEND_SIZE = TcpConnector.MAX_PACKET_SIZE - 
   	                                         TcpConnector.H_SIZE - 
  
  
  
  1.14      +5 -5      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.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- JNIConnectionHandler.java	2000/08/11 21:20:33	1.13
  +++ JNIConnectionHandler.java	2000/08/12 04:55:47	1.14
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/JNIConnectionHandler.java,v 1.13 2000/08/11 21:20:33 costin Exp $
  - * $Revision: 1.13 $
  - * $Date: 2000/08/11 21:20:33 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/connector/JNIConnectionHandler.java,v 1.14 2000/08/12 04:55:47 costin Exp $
  + * $Revision: 1.14 $
  + * $Date: 2000/08/12 04:55:47 $
    *
    * ====================================================================
    *
  @@ -202,7 +202,7 @@
                        int cnt);
   }
   
  -class JNIRequestAdapter extends RequestImpl {
  +class JNIRequestAdapter extends Request {
       static StringManager sm = StringManager.getManager("org.apache.tomcat.resources");
       ContextManager contextM;
       boolean shutdown=false;
  @@ -328,7 +328,7 @@
   
   
   // Ajp use Status: instead of Status
  -class JNIResponseAdapter extends ResponseImpl {
  +class JNIResponseAdapter extends Response {
   
       JNIConnectionHandler h;
       long s;
  
  
  
  1.25      +4 -4      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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- HttpRequestAdapter.java	2000/08/11 21:20:36	1.24
  +++ HttpRequestAdapter.java	2000/08/12 04:55:48	1.25
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v 1.24 2000/08/11 21:20:36 costin Exp $
  - * $Revision: 1.24 $
  - * $Date: 2000/08/11 21:20:36 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v 1.25 2000/08/12 04:55:48 costin Exp $
  + * $Revision: 1.25 $
  + * $Date: 2000/08/12 04:55:48 $
    *
    * ====================================================================
    *
  @@ -73,7 +73,7 @@
   import javax.servlet.*;
   import javax.servlet.http.*;
   
  -public class HttpRequestAdapter extends RequestImpl {
  +public class HttpRequestAdapter extends Request {
       static StringManager sm = StringManager.getManager("org.apache.tomcat.resources");
       private Socket socket;
       private boolean moreRequests = false;
  
  
  
  1.15      +5 -5      jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpResponseAdapter.java
  
  Index: HttpResponseAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpResponseAdapter.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- HttpResponseAdapter.java	2000/08/11 06:14:15	1.14
  +++ HttpResponseAdapter.java	2000/08/12 04:55:48	1.15
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpResponseAdapter.java,v 1.14 2000/08/11 06:14:15 costin Exp $
  - * $Revision: 1.14 $
  - * $Date: 2000/08/11 06:14:15 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpResponseAdapter.java,v 1.15 2000/08/12 04:55:48 costin Exp $
  + * $Revision: 1.15 $
  + * $Date: 2000/08/12 04:55:48 $
    *
    * ====================================================================
    *
  @@ -80,7 +80,7 @@
   
   /**
    */
  -public class HttpResponseAdapter extends  ResponseImpl {
  +public class HttpResponseAdapter extends  Response {
       protected OutputStream sout;
   
       protected static final int DEFAULT_HEAD_BUFFER_SIZE = 1024;
  @@ -107,7 +107,7 @@
       public void endHeaders()  throws IOException {
   	super.endHeaders();
   	
  -	sendStatus( status, ResponseImpl.getMessage( status ));
  +	sendStatus( status, Response.getMessage( status ));
   
   	int count=headers.size();
   	for( int i=0; i<count; i++ ) {
  
  
  
  1.17      +1 -1      jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java
  
  Index: EmbededTomcat.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- EmbededTomcat.java	2000/08/12 02:46:49	1.16
  +++ EmbededTomcat.java	2000/08/12 04:55:48	1.17
  @@ -132,7 +132,7 @@
   	sc.setAttribute( "socketFactory",
   			 "org.apache.tomcat.net.SSLSocketFactory");
   	//	log("XXX " + keyFile + " " + keyPass);
  -	HttpConnectionHandler ch=new HttpConnectionHandler();
  +	HttpConnectionHandler hc=new HttpConnectionHandler();
   	hc.setSecure(true);
   	sc.setTcpConnectionHandler( hc );
   	// XXX add the secure socket
  
  
  

Mime
View raw message