summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2012-04-14 18:51:09 +0200
committerYorhel <git@yorhel.nl>2012-04-14 18:51:09 +0200
commit11644bfbf662601f7f2a51e9cb23a90a644564b0 (patch)
treed1b615550ca34f2bf34d7e00a1a9f3fe0e13927b
parentcbce146adb7d281cfd0e14d03e77eab5af08748a (diff)
Fixed infinite loop in flusher goroutine
Oops...
-rw-r--r--wr.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/wr.go b/wr.go
index d2c5ebe..b76f7cf 100644
--- a/wr.go
+++ b/wr.go
@@ -173,7 +173,7 @@ func (w *Writer) Write(b []byte) (int, error) {
func (w *Writer) flusher() {
w.lock.Lock()
defer w.lock.Unlock()
- for {
+ for len(buf) > 0 {
buf := w.buf
size := len(buf)
// Don't give too many data to a single Write(), otherwise it