Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 8918 invoked by uid 500); 3 Jul 2000 09:38:07 -0000 Delivered-To: apmail-jakarta-tomcat-cvs@apache.org Received: (qmail 8904 invoked by uid 1049); 3 Jul 2000 09:38:07 -0000 Date: 3 Jul 2000 09:38:06 -0000 Message-ID: <20000703093806.8895.qmail@locus.apache.org> From: bergsten@locus.apache.org To: jakarta-tomcat-cvs@apache.org Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core RequestImpl.java bergsten 00/07/03 02:38:05 Modified: src/share/org/apache/tomcat/core Tag: tomcat_32 RequestImpl.java Log: URL rewriting didn't work if an instance that previously had been used with a cookie based session ID was used to handle a new request without session ID. Fixed by resetting sessionIdSource in recycle() Revision Changes Path No revision No revision 1.52.2.1 +24 -22 jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java Index: RequestImpl.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/RequestImpl.java,v retrieving revision 1.52 retrieving revision 1.52.2.1 diff -u -r1.52 -r1.52.2.1 --- RequestImpl.java 2000/06/29 18:01:30 1.52 +++ RequestImpl.java 2000/07/03 09:38:01 1.52.2.1 @@ -78,6 +78,7 @@ * @author Jason Hunter [jch@eng.sun.com] * @author Harish Prabandham * @author Alex Cruikshank [alex@epitonic.com] + * @author Hans Bergsten [hans@gefionsoftware.com] */ public class RequestImpl implements Request { @@ -102,7 +103,7 @@ // Need to distinguish between null pathTranslated and // lazy-computed pathTranlsated protected boolean pathTranslatedIsSet=false; - + protected Hashtable parameters = new Hashtable(); protected int contentLength = -1; protected String contentType = null; @@ -115,7 +116,7 @@ // active roles for the current user protected String userRoles[]; protected String reqRoles[]; - + // Request protected Response response; protected HttpServletRequest requestFacade; @@ -159,7 +160,7 @@ Request top; Request parent; Request child; - + protected static StringManager sm = StringManager.getManager("org.apache.tomcat.core"); @@ -206,7 +207,7 @@ /** Return the server name. If none was set, * extract it from the host header. - * + * */ public String getServerName() { if(serverName!=null) return serverName; @@ -253,7 +254,7 @@ return null; } } - + public String[] getParameterValues(String name) { handleParameters(); return (String[])parameters.get(name); @@ -326,7 +327,7 @@ public String getPathInfo() { return pathInfo; } - + public void setRemoteUser(String s) { remoteUser=s; // this is set by an auth module @@ -344,14 +345,14 @@ } public boolean isSecure() { - // The adapter is responsible for providing this information + // The adapter is responsible for providing this information return getScheme().equalsIgnoreCase("HTTPS"); } - + public void setUserPrincipal( Principal p ) { principal=p; } - + /** Return the principal - the adapter will set it */ public Principal getUserPrincipal() { @@ -359,7 +360,7 @@ if( principal == null ) { principal=new SimplePrincipal( getRemoteUser() ); } - return principal; + return principal; } public void setRequiredRoles( String roles[] ) { @@ -460,16 +461,16 @@ // if not null, it is validated by the session module return serverSession; } - + if( ! create ) return null; - + // context.log("RequestImpl: created new session!"); contextM.doNewSessionRequest( this, response ); if ( serverSession == null ) { context.log("RequestImpl: no session created!"); return null; } - + reqSessionId = serverSession.getId(); response.setSessionId( reqSessionId ); @@ -492,7 +493,7 @@ } return (Cookie)cookies.elementAt(idx); } - + public Cookie[] getCookies() { int count=getCookieCount(); Cookie[] cookieArray = new Cookie[ count ]; @@ -589,10 +590,10 @@ if( value != null ) return value; - // allow access to FacadeManager for servlets + // 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 context.getAttribute( name ); } return null; } @@ -629,7 +630,7 @@ public Request getChild() { return child; } - + public void setChild( Request req ) { child=req; } @@ -652,7 +653,7 @@ } return top; } - + // -------------------- Facade for MimeHeaders public Enumeration getHeaders(String name) { // Vector v = reqA.getMimeHeaders().getHeadersVector(name); @@ -719,6 +720,7 @@ pathTranslated=null; pathInfo=null; pathTranslatedIsSet=false; + sessionIdSource = null; // XXX a request need to override those if it cares // about security @@ -756,7 +758,7 @@ bBuffer=buf; } - + public ServletInputStream getInputStream() throws IOException { return in; } @@ -838,12 +840,12 @@ public String getLocalHost() { return localHost; } - + public void setLocalHost(String host) { this.localHost = host; } - + public String toString() { StringBuffer sb=new StringBuffer(); sb.append( "R( "); @@ -881,7 +883,7 @@ 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];