From e4435a8d1e15c79f8cc5c8e78a260f3f7ff77fe7 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Sun, 5 Jul 2015 17:07:45 -0700 Subject: [PATCH] Log embellishment --- common/bit_array.go | 1 + p2p/connection.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/bit_array.go b/common/bit_array.go index d478d02e..320b629e 100644 --- a/common/bit_array.go +++ b/common/bit_array.go @@ -156,6 +156,7 @@ func (bA *BitArray) Sub(o *BitArray) *BitArray { i := len(o.Elems) - 1 if i >= 0 { for idx := i * 64; idx < o.Bits; idx++ { + // NOTE: each individual GetIndex() call to o is safe. c.setIndex(idx, c.getIndex(idx) && !o.GetIndex(idx)) } } diff --git a/p2p/connection.go b/p2p/connection.go index 9984d835..aa4b4394 100644 --- a/p2p/connection.go +++ b/p2p/connection.go @@ -419,7 +419,7 @@ FOR_LOOP: } msgBytes := channel.recvMsgPacket(pkt) if msgBytes != nil { - //log.Debug("Received bytes", "chId", pkt.ChannelId, "msgBytes", msgBytes) + log.Debug("Received bytes", "chId", pkt.ChannelId, "msgBytes", msgBytes) c.onReceive(pkt.ChannelId, msgBytes) } default: @@ -605,7 +605,7 @@ type msgPacket struct { } func (p msgPacket) String() string { - return fmt.Sprintf("MsgPacket{%X:%X}", p.ChannelId, p.Bytes) + return fmt.Sprintf("MsgPacket{%X:%X T:%X}", p.ChannelId, p.Bytes, p.EOF) } //-----------------------------------------------------------------------------