You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2001/08/12 04:00:23 UTC

cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade HttpServletRequestFacade.java Servlet22Interceptor.java

costin      01/08/11 19:00:23

  Modified:    src/facade22/org/apache/tomcat/facade
                        HttpServletRequestFacade.java
                        Servlet22Interceptor.java
  Log:
  Few more debug statements in Servlet22Interceptor ( tracking session event
  bugs )
  
  Return "null" if getCharacterEncoding is not determined from "reliable"
  sources ( i.e. it is a default ) . Request.getCharacterEncoding will return
  not null ( i.e. the default will be set there, by various modules instead of
  beeing hardcoded here ).
  
  Revision  Changes    Path
  1.25      +11 -5     jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletRequestFacade.java
  
  Index: HttpServletRequestFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletRequestFacade.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- HttpServletRequestFacade.java	2001/05/26 18:09:22	1.24
  +++ HttpServletRequestFacade.java	2001/08/12 02:00:23	1.25
  @@ -148,7 +148,16 @@
       }
       
       public String getCharacterEncoding() {
  -	return request.getCharacterEncoding();
  +	String enc=request.getCharacterEncoding();
  +
  +	// Source is set if we are sure about the encoding,
  +	// we've got it from header or session or some
  +	// well-defined mechanism. No source means the default
  +	// is used.
  +	Object o=request.getNote( "req.encodingSource" );
  +	if( o==null ) return null;
  +	
  +	return enc;
       }
   
       public int getContentLength() {
  @@ -332,9 +341,6 @@
   
   	// XXX  provide recycleable objects
   	String encoding = request.getCharacterEncoding();
  -        if (encoding == null) {
  -            encoding = "8859_1"; // that's the default in HTTP and servlet spec
  -        }
   	
   	InputStreamReader r =
               new InputStreamReader(isFacade, encoding);
  @@ -347,7 +353,7 @@
       }
   
       public String getRemoteHost() {
  -		String remoteHost = request.remoteHost().toString();
  +	String remoteHost = request.remoteHost().toString();
   
           // AJP12 defaults to empty string, AJP13 defaults to null
           if(remoteHost != null && remoteHost.length() != 0)
  
  
  
  1.16      +5 -1      jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java
  
  Index: Servlet22Interceptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Servlet22Interceptor.java	2001/03/23 16:32:21	1.15
  +++ Servlet22Interceptor.java	2001/08/12 02:00:23	1.16
  @@ -169,9 +169,13 @@
        */
       public int sessionState( Request req, ServerSession sess, int newState)
       {
  +	if( debug > 0 )
  +	    log("sessionState " + sess.getId() + " " + newState + " " + sess.getState());
   	if( newState==ServerSession.STATE_SUSPEND ||
   	    newState==ServerSession.STATE_EXPIRED )   {
  -	    
  +
  +	    if( debug > 0 )
  +		log("Unbinding variables ");
   	    // generate "unbould" events when the session is suspended or
   	    // expired
   	    HttpSession httpSess=(HttpSession)sess.getFacade();