Skip to content

Commit 2680ad3

Browse files
committed
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: 6d77637
1 parent 9e07749 commit 2680ad3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

statsrelay.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"time"
2222
)
2323

24-
const VERSION string = "0.0.6"
24+
const VERSION string = "0.0.7"
2525

2626
// BUFFERSIZE controls the size of the [...]byte array used to read UDP data
2727
// off the wire and into local memory. Metrics are separated by \n
@@ -273,7 +273,7 @@ func handleBuff(buff []byte) {
273273

274274
// check built packet size and send if metric doesn't fit
275275
if packets[target].Len()+size > packetLen {
276-
go sendPacket(packets[target].Bytes(), target, sendproto, TCPtimeout, boff)
276+
sendPacket(packets[target].Bytes(), target, sendproto, TCPtimeout, boff)
277277
packets[target].Reset()
278278
}
279279
// add to packet

0 commit comments

Comments
 (0)