[ https://issues.apache.org/jira/browse/SYNAPSE-1028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306408#comment-15306408 ]
Hiranya Jayathilaka edited comment on SYNAPSE-1028 at 5/30/16 8:50 AM: ----------------------------------------------------------------------- I'm attaching a possible fix for the problems outlined here. I'm not fully caught up with the latest developments of the PTT, so I appreciate if somebody else can review this patch and provide some feedback. All the tests are passing with this patch (including the integration test 10101 which tests for DISABLE_CHUNKING feature) was (Author: hiranya): I'm attaching a possible fix for the problems outlined here. I'm not fully caught up with the latest developments of the PTT, so I appreciate if somebody else can review this patch and provide some feedback. > 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: dev-unsubscr...@synapse.apache.org For additional commands, e-mail: dev-h...@synapse.apache.org