[
https://issues.apache.org/jira/browse/SYNAPSE-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15315726#comment-15315726
]
Ravi Undupitiya commented on SYNAPSE-1028:
------------------------------------------
I've gone through the change and it seems fine to me. It is also consistent
with the one in https://wso2.org/jira/browse/ESBJAVA-3297, with the minor
difference where setStreamAsTempData() calls the formatter writeTo() with
preservation turned on. Based on axis2 formatter code, this should call
serializeAndConsume method which should according to [1] define how MTOM is
encoded based on setDoOptimize(). I think in that case, leaving preservation
flag as true should be correct.
[1]
https://ws.apache.org/axiom/apidocs/org/apache/axiom/om/OMContainer.html#serializeAndConsume(java.io.OutputStream,
org.apache.axiom.om.OMOutputFormat)
> Possible Bugs in Code for Handling Content Length Encoding
> ----------------------------------------------------------
>
> Key: SYNAPSE-1028
> URL: https://issues.apache.org/jira/browse/SYNAPSE-1028
> Project: Synapse
> Issue Type: Bug
> Components: Transports
> Affects Versions: NIGHTLY
> Reporter: Hiranya Jayathilaka
> Assignee: Ravi Undupitiya
> Priority: Blocker
> Fix For: 3.0
>
> Attachments: SYNAPSE-1028.patch
>
>
> If I'm not mistaken, the following bit of code in PassThroughHttpSender
> serializes the same message at least 3 times:
> {code}
> if("true".equals(disableChunking) || "true".equals(forceHttp10) ){
> ByteArrayOutputStream _out = new ByteArrayOutputStream();
> MessageFormatter formatter =
> MessageProcessorSelector.getMessageFormatter(msgContext);
> OMOutputFormat format =
> PassThroughTransportUtils.getOMOutputFormat(msgContext);
> formatter.writeTo(msgContext, format, _out, false);
> try {
> long messageSize = setStreamAsTempData(formatter, msgContext, format);
> msgContext.setProperty(
> PassThroughConstants.PASS_THROUGH_MESSAGE_LENGTH, messageSize);
> formatter.writeTo(msgContext, format, out, false);
> } catch (IOException e) {
> handleException("I/O error while serializing message", e);
> }
> {code}
> Also the setStreamAsTempData method uses a deprecated Axiom API.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]