classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-javamail] bug found


From: Chris Burdess
Subject: Re: [Classpathx-javamail] bug found
Date: Wed, 8 Jun 2005 07:29:42 +0100
User-agent: Mutt/1.3.28i

Archit Shah wrote:
> A bug in classpathx mail was found when using it with Apache Axis. The 
> problem is in source/javax/mail/internet/InternetHeaders.java. I've 
> attached a junit test case that shows how the class operates differently 
> on buffered versus unbuffered input streams. I believe line 335 is the key:
> 
> LineInputStream in = new LineInputStream(new CRLFInputStream(is));
> 
> The CRLFInputStream wraps the original input stream in a buffered input 
> stream when markSupported() returns false. If there is data in the 
> original input stream after the headers, then it gets lost in the 
> buffered input stream created in the CRLFInputStream constructor. 
> Changing InternetHeaders to not use CRLFInputStream seems to fix the 
> problem (patch attached):
> 
> LineInputStream in = new LineInputStream(is);
> 
> This change also re-instates the recognition of either '\n' or '\r\n' as 
>  line terminators in header parsing. This matches the behavior of the 
> rfc822 module in python 2.3 and doesn't seem unreasonable.

This patch has been applied. Thank you very much.
-- 
Chris Burdess




reply via email to

[Prev in Thread] Current Thread [Next in Thread]