Return-Path: Mailing-List: contact commons-httpclient-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-httpclient-dev@jakarta.apache.org Received: (qmail 84078 invoked from network); 29 Aug 2003 17:33:27 -0000 Received: from unknown (HELO brmea-mail-3.sun.com) (192.18.98.34) by daedalus.apache.org with SMTP; 29 Aug 2003 17:33:27 -0000 Received: from centralmail2brm.Central.Sun.COM ([129.147.62.14]) by brmea-mail-3.sun.com (8.12.9/8.12.9) with ESMTP id h7THXLqe002103 for ; Fri, 29 Aug 2003 11:33:21 -0600 (MDT) Received: from sr1-uaus-01.Central.Sun.COM (sr1-uaus-01.Central.Sun.COM [129.153.131.85]) by centralmail2brm.Central.Sun.COM (8.12.9+Sun/8.12.9/ENSMAIL,v2.2) with ESMTP id h7THXKcm010155 for ; Fri, 29 Aug 2003 11:33:20 -0600 (MDT) Received: from sun.com (localhost [127.0.0.1]) by sr1-uaus-01.Central.Sun.COM (8.12.9+Sun/8.12.5) with ESMTP id h7THXJJI026649 for ; Fri, 29 Aug 2003 12:33:20 -0500 (CDT) Message-ID: <3F4F8E5F.4020109@sun.com> Date: Fri, 29 Aug 2003 12:33:19 -0500 From: Yue Luo User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.1) Gecko/20020827 X-Accept-Language: en-us, en MIME-Version: 1.0 To: commons-httpclient-dev@jakarta.apache.org Subject: A bug? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi, Version 2.0-rc1 When HttpConnection.closeSocketAndStream() is called, it first closes the input stream, and then it closes the output stream. When I am using JSSE, the output stream seems to be also closed by the underlying system when the input stream is closed. So when this method tries to close the output stream ( a buffered stream), flush() method will be called first implicitly. Then an IOException will be thrown because the underlying stream is considered closed. WrappedOutputStream.flush() will catch the exception and then WrappedOutputStream.handleException() will be called to convert the exception to a HttpRecoverableException. This exception is throw in perfect normal working condition, so I suppose it is a bug, although the end user will not notice it. I would suggest closing output stream before closing input stream in HttpConnection.closeSocketAndStream(). I am curious, is it really necessary to close the streams separately? Or can we just close the socket directly? Another minor typo bug, the LOG message in HttpMethodBase.readResponseBody(HttpConnection conn) is wrong. It is for the other method with the same name. It is probably a copy & paste bug. Thanks. Yue