Show only the first 128 bytes of chunks

This commit is contained in:
Daniel A. Nagy 2015-02-13 11:59:31 +01:00
parent 796b0bf0b6
commit 41c4e97182

View file

@ -300,7 +300,11 @@ func (p *Peer) dispatch(msg Msg, protoDone chan struct{}) (wait bool, err error)
// of it and move on to the next message
buf, err := ioutil.ReadAll(msg.Payload)
if len(buf) > 0 {
p.Debugf("Received message %x", buf)
if len(buf) < 128 {
p.Debugf("Received message %x", buf)
} else {
p.Debugf("Received message %x", buf[:128])
}
}
if err != nil {
return false, err