From cc2dd53de8b8f3d978371553b81d4d6f5eef81e9 Mon Sep 17 00:00:00 2001 From: Joseph Lawson Date: Fri, 28 Mar 2014 23:21:47 -0400 Subject: [PATCH] write full message to new array for async buffer --- output_tcp.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/output_tcp.go b/output_tcp.go index bb2aac7..bc49060 100644 --- a/output_tcp.go +++ b/output_tcp.go @@ -44,12 +44,14 @@ func (o *TCPOutput) worker() { for { conn.Write(<-o.buf) - conn.Write([]byte("¶")) } } func (o *TCPOutput) Write(data []byte) (n int, err error) { - o.buf <- data + new_buf := make([]byte, len(data) + 2) + append(data, []byte("¶")) + copy(new_buf, data) + o.buf <- new_buf return len(data), nil }