Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Delivered-To: moderator for tomcat-dev@jakarta.apache.org Received: (qmail 35139 invoked from network); 19 Nov 2000 23:53:36 -0000 Received: from relay.lutris.com (63.104.189.21) by locus.apache.org with SMTP; 19 Nov 2000 23:53:36 -0000 Received: (from root@localhost) by relay.lutris.com (8.9.3/8.9.3) id PAA03288 for ; Sun, 19 Nov 2000 15:57:13 -0800 Received: from mail01.lutris.com (mail [63.104.189.54]) by relay.lutris.com (8.9.3/8.9.3) with ESMTP id PAA03201 for ; Sun, 19 Nov 2000 15:57:13 -0800 Received: from lutris.com ([10.10.50.130]) by mail01.lutris.com (Netscape Messaging Server 4.15) with ESMTP id G4AQDC00.74Z; Sun, 19 Nov 2000 15:53:36 -0800 Message-ID: <3A1867F6.EB043E41@lutris.com> Date: Sun, 19 Nov 2000 18:53:26 -0500 From: Shawn McMurdo Organization: Lutris Technologies, Inc. X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: [PATCH] Tomcat 3.2 RequestImpl.java Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Here is a small patch for Tomcat 3.2. The constructor was calling recycle, which caused me some problems when extending the class. It separates the request initialization done in the constructor out of the recycle method. This fixes a "XXX" marked piece of code and resolves a problem that I had when extending the RequestImpl class and overriding recycle(). Please consider this patch for inclusion in Tomcat 3.2. It should have no real functional impact on the standard Tomcat, but fixes a potential problem with embedding Tomcat. Thanks. Shawn PS: Hopefully the patch will come through ok, since I was having trouble with ftp access to my development machine, I had to cut and past it into this message. Let me know if you have trouble with it. *** RequestImpl.java.old Sun Nov 19 15:22:28 2000 --- RequestImpl.java Sun Nov 19 15:29:53 2000 *************** *** 167,173 **** public RequestImpl() { // System.out.println("XXX new ri " ); headers = new MimeHeaders(); ! recycle(); // XXX need better placement-super() } public void setContext(Context context) { --- 167,173 ---- public RequestImpl() { // System.out.println("XXX new ri " ); headers = new MimeHeaders(); ! initRequest(); } public void setContext(Context context) { *************** *** 694,705 **** } } ! // -------------------- End utils ! public void recycle() { ! if( requestFacade != null && context!=null ) { ! context.getFacadeManager().recycle(this); ! } ! context = null; attributes.clear(); parameters.clear(); --- 694,700 ---- } } ! public void initRequest() { context = null; attributes.clear(); parameters.clear(); *************** *** 748,753 **** --- 743,757 ---- reqRoles=null; } + // -------------------- End utils + public void recycle() { + if( requestFacade != null && context!=null ) { + context.getFacadeManager().recycle(this); + } + + initRequest(); + } + public MimeHeaders getMimeHeaders() { return headers; } -- Shawn McMurdo mailto:shawn@lutris.com Lutris Technologies http://www.lutris.com Enhydra.Org http://www.enhydra.org