Re: bug found
Chris Burdess <[email protected]> Wed, 8 Jun 2005 07:29:42 +0100
| Newsgroups | gmane.comp.java.classpath.extensions.javamail |
|---|---|
| Message-ID | <[email protected]> |
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