You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@activemq.apache.org by GitBox <gi...@apache.org> on 2019/08/26 02:11:33 UTC

[GitHub] [activemq-artemis] clebertsuconic commented on a change in pull request #2809: ARTEMIS-2454 Fixing body re-encoding

clebertsuconic commented on a change in pull request #2809: ARTEMIS-2454 Fixing body re-encoding
URL: https://github.com/apache/activemq-artemis/pull/2809#discussion_r317430889
 
 

 ##########
 File path: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/broker/AMQPMessage.java
 ##########
 @@ -228,20 +227,23 @@ public MessageImpl getProtonMessage() {
     * @return a copy of the Message Header if one exists or null if none present.
     */
    public Header getHeader() {
-      ensureMessageDataScanned();
-      ensureDataIsValid();
+      ensureScanning();
       return scanForMessageSection(headerPosition, Header.class);
    }
 
+   private void ensureScanning() {
+      ensureDataIsValid();
 
 Review comment:
   Before someone asks.. the inversion of order here was on purpose...
   
   We need to first ensure the data buffer is valid, and if needed to be re-encoded...
   
   Then after the re-encoding, we need to re-scan the data.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services