Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DABF874F2 for ; Tue, 26 Jul 2011 16:15:46 +0000 (UTC) Received: (qmail 75434 invoked by uid 500); 26 Jul 2011 16:15:43 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 75339 invoked by uid 500); 26 Jul 2011 16:15:42 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 75330 invoked by uid 99); 26 Jul 2011 16:15:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 16:15:42 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [76.96.62.16] (HELO qmta01.westchester.pa.mail.comcast.net) (76.96.62.16) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Jul 2011 16:15:33 +0000 Received: from omta24.westchester.pa.mail.comcast.net ([76.96.62.76]) by qmta01.westchester.pa.mail.comcast.net with comcast id CgB11h00B1ei1Bg51gFE3y; Tue, 26 Jul 2011 16:15:14 +0000 Received: from [192.168.1.70] ([99.122.40.71]) by omta24.westchester.pa.mail.comcast.net with comcast id CgF11h00E1Y70rn3kgF69Q; Tue, 26 Jul 2011 16:15:12 +0000 Message-ID: <4E2EE804.8000701@christopherschultz.net> Date: Tue, 26 Jul 2011 12:15:00 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: AJP-APR failures on Tomcat 7.0.16 with ISAPI Redirector 1.2.32 References: <002d01cc3f3c$b1e208b0$15a61a10$@preisser@t-online.de> <004f01cc40c6$fdf8b920$f9ea2b60$@preisser@t-online.de> <4E1C9F73.4000702@ice-sa.com> <000301cc40e4$17c7e840$4757b8c0$@preisser@t-online.de> <4E1E1945.3020005@kippdata.de> <005901cc41af$c0fd4dd0$42f7e970$@preisser@t-online.de> <4E1ECC24.5010103@ice-sa.com> <003a01cc4223$501788f0$f0469ad0$@preisser@t-online.de> In-Reply-To: <003a01cc4223$501788f0$f0469ad0$@preisser@t-online.de> X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Konstantin, On 7/14/2011 8:41 AM, eurotrans-Verlag wrote: > An alternative that I could imagine, would be to create a class > (that has a boolean flag) which extends OutputStream, and decorates > another OutputStream that is given to the class in the constructor > (that would be the OutputStream from the servlet's response). This > class would pass all calls to it to the other OutputStream (as long > as the flag is true), and as soon as close() or another special > method is called, it sets the flag to false, which causes all other > methods to do nothing (or throw an IOException). That way, Tomcat's > OutputStream would also be protected from future calls from the > ImageIO. You should also null-out the reference to Tomcat's output stream. This would allow you to "leak" your own decorator objects but not interfere with Tomcat's ability to do it's own object management. Such a class would definitely be useful to post on the Wiki. > However, it seems also a bit strange to me that Tomcat is recycling > OutputStreams, because in my understanding, once an OutputStream is > closed, it should be impossible to do any further write() calls to > it. True, but Tomcat tries to avoid as much memory churn as possible, and re-uses objects whenever possible. You can change this behavior with configuration if you want. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4u6AQACgkQ9CaO5/Lv0PD6cACfW4BS55+FtwpK3ZonNjOuvfPV v+MAn3iCTpTSI+FOBkgdI9UOZD4YvsM6 =oazD -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org