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/facade22/org/apache/tomcat/facade HttpServletResponseFacade.java
Date Tue, 26 Dec 2000 22:50:48 GMT
costin      00/12/26 14:50:48

  Modified:    src/facade22/org/apache/tomcat/facade
                        HttpServletResponseFacade.java
  Log:
  Use the changes in ServerSession.
  
  Revision  Changes    Path
  1.14      +13 -16    jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletResponseFacade.java
  
  Index: HttpServletResponseFacade.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/HttpServletResponseFacade.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- HttpServletResponseFacade.java	2000/12/01 06:00:24	1.13
  +++ HttpServletResponseFacade.java	2000/12/26 22:50:47	1.14
  @@ -112,10 +112,19 @@
   	if( response.isIncluded() ) return;
   	// layer costs - this can be avoided, but it's not a
   	// frequent operation ( for example sc can be reused )
  -	ServerCookie sc=new ServerCookie();
  -	cookie2serverCookie( cookie, sc);
  -	addHeader( sc.getCookieHeaderName(),
  -		   sc.getCookieHeaderValue());
  +
  +	// XXX reuse
  +	StringBuffer sb=new StringBuffer();
  +	ServerCookie.appendCookieValue( sb, cookie.getVersion(),
  +				       cookie.getName(), cookie.getValue(),
  +				       cookie.getPath(), cookie.getDomain(),
  +				       cookie.getComment(), cookie.getMaxAge(),
  +				       cookie.getSecure());
  +	// the header name is Set-Cookie for both "old" and v.1 ( RFC2109 )
  +	// RFC2965 is not supported by browsers and the Servlet spec
  +	// asks for 2109.
  +	addHeader( "Set-Cookie", 
  +		   sb.toString());
       }
   
       public boolean containsHeader(String name) {
  @@ -447,17 +456,5 @@
   	    sb.append(query);
   	return (sb.toString());
   
  -    }
  -
  -
  -    private void cookie2serverCookie( Cookie cookie, ServerCookie sc ) {
  -	sc.getName().setString( cookie.getName() );
  -	sc.setVersion( cookie.getVersion());
  -	sc.getValue().setString( cookie.getValue() );
  -	sc.getPath().setString(cookie.getPath());
  -	sc.getDomain().setString( cookie.getDomain());
  -	sc.getComment().setString( cookie.getComment());
  -	sc.setMaxAge( cookie.getMaxAge() );
  -	sc.setSecure( cookie.getSecure());
       }
   }
  
  
  

Mime
View raw message