You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2008/06/13 01:14:46 UTC

[jira] Created: (SYNAPSE-359) Incorrect use of Message#getSize() in MailUtils

Incorrect use of Message#getSize() in MailUtils
-----------------------------------------------

                 Key: SYNAPSE-359
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-359
             Project: Synapse
          Issue Type: Bug
          Components: Transports
    Affects Versions: 1.2
            Reporter: Andreas Veithen
            Assignee: Andreas Veithen
             Fix For: 1.3


The Javadoc of the Message#getSize() method specifies that "the size may not be an exact measure of the content size and may or may not account for any transfer encoding  of the content. The size is appropriate for display in a user interface to give the user a rough idea of the size of this part." However MailUtils#getMessageTextPayload and MailUtils#getMessageBinaryPayload in conjunction with MailUtils#getBytesFromInputStream use this information to allocate a buffer and subsequently compare it with the number of bytes actually read from the message. When the estimation returned by getSize is not accurate, this leads to a failure with error message "Could not completely read the stream to conver to a byte[]". Therefore the mail transport listener is in general unable to process plain text or binary messages correctly.

Note that the code causing this issue will be replaced by the modifications proposed in SYNAPSE-304.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


[jira] Resolved: (SYNAPSE-359) Incorrect use of Message#getSize() in MailUtils

Posted by "Andreas Veithen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SYNAPSE-359?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved SYNAPSE-359.
-------------------------------------

    Resolution: Fixed

> Incorrect use of Message#getSize() in MailUtils
> -----------------------------------------------
>
>                 Key: SYNAPSE-359
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-359
>             Project: Synapse
>          Issue Type: Bug
>          Components: Transports
>    Affects Versions: 1.2
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>             Fix For: 1.3
>
>
> The Javadoc of the Message#getSize() method specifies that "the size may not be an exact measure of the content size and may or may not account for any transfer encoding  of the content. The size is appropriate for display in a user interface to give the user a rough idea of the size of this part." However MailUtils#getMessageTextPayload and MailUtils#getMessageBinaryPayload in conjunction with MailUtils#getBytesFromInputStream use this information to allocate a buffer and subsequently compare it with the number of bytes actually read from the message. When the estimation returned by getSize is not accurate, this leads to a failure with error message "Could not completely read the stream to conver to a byte[]". Therefore the mail transport listener is in general unable to process plain text or binary messages correctly.
> Note that the code causing this issue will be replaced by the modifications proposed in SYNAPSE-304.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org