Fix --input-tcp for payloads > 64kb

This commit is contained in:
Leonid Bugaev
2016-05-17 19:56:13 +05:00
parent 37d657fc33
commit d40d6c6116
4 changed files with 29 additions and 73 deletions
+2 -2
View File
@@ -71,7 +71,7 @@ func (i *FileInput) emit() {
}
if bytes.Equal(payloadSeparatorAsBytes[1:], line) {
asBytes := buffer.Bytes()[:buffer.Len()-1]
asBytes := buffer.Bytes()
buffer.Reset()
meta := payloadMeta(asBytes)
@@ -93,7 +93,7 @@ func (i *FileInput) emit() {
}
// Bytes() returns only pointer, so to remove data-race copy the data to an array
newBuf := make([]byte, len(asBytes))
newBuf := make([]byte, len(asBytes)-1)
copy(newBuf, asBytes)
i.data <- newBuf