Skip to content

Commit

Permalink
Issue #20
Browse files Browse the repository at this point in the history
Don't rewrite a bytes.Buffer while we are actively sending from the same
underlying []byte array.  This causes expected corruption.

Introduced in:

    6d77637
  • Loading branch information
jjneely committed Jan 6, 2018
1 parent 9e07749 commit 2680ad3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions statsrelay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2680ad3

Please sign in to comment.