From 2680ad3b48432eaeee33d2615c3d6b549a3decb1 Mon Sep 17 00:00:00 2001 From: Jack Neely Date: Fri, 5 Jan 2018 22:13:17 -0500 Subject: [PATCH] Issue #20 Don't rewrite a bytes.Buffer while we are actively sending from the same underlying []byte array. This causes expected corruption. Introduced in: 6d77637e8890c4059674f10fc75e3cca6b9e4a83 --- statsrelay.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/statsrelay.go b/statsrelay.go index 93bf3bf..42da0d2 100644 --- a/statsrelay.go +++ b/statsrelay.go @@ -21,7 +21,7 @@ import ( "time" ) -const VERSION string = "0.0.6" +const VERSION string = "0.0.7" // BUFFERSIZE controls the size of the [...]byte array used to read UDP data // off the wire and into local memory. Metrics are separated by \n @@ -273,7 +273,7 @@ func handleBuff(buff []byte) { // check built packet size and send if metric doesn't fit if packets[target].Len()+size > packetLen { - go sendPacket(packets[target].Bytes(), target, sendproto, TCPtimeout, boff) + sendPacket(packets[target].Bytes(), target, sendproto, TCPtimeout, boff) packets[target].Reset() } // add to packet