activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gemmellr <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #1601: ARTEMIS-1472 - PN_TRACE_FRM as System.o...
Date Fri, 20 Oct 2017 09:03:41 GMT
Github user gemmellr commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1601#discussion_r145906703
  
    --- Diff: artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/AMQPConnectionContext.java
---
    @@ -143,13 +144,26 @@ public SASLResult getSASLResult() {
        }
     
        public void inputBuffer(ByteBuf buffer) {
    -      if (log.isTraceEnabled()) {
    -         ByteUtil.debugFrame(log, "Buffer Received ", buffer);
    +      if (PN_TRACE_FRM) {
    +         debugFrame(buffer);
           }
     
           handler.inputBuffer(buffer);
        }
     
    +   private static void debugFrame(ByteBuf byteIn) {
    +      int location = byteIn.readerIndex();
    +      // debugging
    +      byte[] frame = new byte[byteIn.writerIndex()];
    +      byteIn.readBytes(frame);
    +
    +      if (PN_TRACE_FRM) {
    --- End diff --
    
    This was checked already before calling the method. Ignoring that it would probably also
be better done around the whole contents of the method to avoid creating the byte array but
then not using it and then needing to readjust the buffer index later.


---

Mime
View raw message