You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ri...@apache.org on 2008/06/19 15:56:37 UTC
svn commit: r669490 - in
/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail:
internet/MimeMessage.java util/SharedFileInputStream.java
Author: rickmcguire
Date: Thu Jun 19 06:56:37 2008
New Revision: 669490
URL: http://svn.apache.org/viewvc?rev=669490&view=rev
Log:
GERONIMO-4129 genorimo MimeMessage extensibility internal behaviour vs sun implementation OOM issue.
More issues uncovered by the James test suite.
Modified:
geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java
geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/util/SharedFileInputStream.java
Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java?rev=669490&r1=669489&r2=669490&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java (original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java Thu Jun 19 06:56:37 2008
@@ -259,8 +259,10 @@
*/
protected void parse(InputStream in) throws MessagingException {
in = new BufferedInputStream(in);
- // create the headers first from the stream
- headers = new InternetHeaders(in);
+ // create the headers first from the stream. Note: We need to do this
+ // by calling createInternetHeaders because subclasses might wish to add
+ // additional headers to the set initialized from the stream.
+ headers = createInternetHeaders(in);
// now we need to get the rest of the content as a byte array...this means reading from the current
// position in the stream until the end and writing it to an accumulator ByteArrayOutputStream.
@@ -1433,6 +1435,16 @@
}
+ /**
+ * Create a new set of internet headers from the
+ * InputStream
+ *
+ * @param in The header source.
+ *
+ * @return A new InternetHeaders object containing the
+ * appropriate headers.
+ * @exception MessagingException
+ */
protected InternetHeaders createInternetHeaders(InputStream in) throws MessagingException {
// internet headers has a constructor for just this purpose
return new InternetHeaders(in);
Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/util/SharedFileInputStream.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/util/SharedFileInputStream.java?rev=669490&r1=669489&r2=669490&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/util/SharedFileInputStream.java (original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/util/SharedFileInputStream.java Thu Jun 19 06:56:37 2008
@@ -198,8 +198,6 @@
bufpos += count;
}
else {
-
-
// we have marks to worry about....damn.
// if we have room in the buffer to read more data, then we will. Otherwise, we need to see
// if it's possible to shift the data in the buffer or extend the buffer (up to the mark limit).
@@ -239,6 +237,9 @@
// if we're past our designated end, force an eof.
if (bufpos + pos >= start + datalen) {
+ // make sure we zero the count out, otherwise we'll reuse this data
+ // if called again.
+ count = pos;
return false;
}
@@ -257,6 +258,9 @@
// we weren't able to read anything, count this as an eof failure.
if (fillLength <= 0) {
+ // make sure we zero the count out, otherwise we'll reuse this data
+ // if called again.
+ count = pos;
return false;
}