Skip to content

Commit

Permalink
Merge pull request #69 from markrechler/fix_listener_close
Browse files Browse the repository at this point in the history
ensure listener does not close on parse errors
  • Loading branch information
jehiah committed May 18, 2015
2 parents fcbcfd0 + e7ff264 commit b8e9317
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 2 additions & 4 deletions statsdaemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,12 +569,10 @@ func parseTo(conn io.ReadCloser, partialReads bool, out chan<- *Packet) {
parser := NewParser(conn, partialReads)
for {
p, more := parser.Next()
if p == nil {
break
if p != nil {
out <- p
}

out <- p

if !more {
break
}
Expand Down
2 changes: 2 additions & 0 deletions statsdaemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,8 @@ func TestMultipleUDPSends(t *testing.T) {
assert.Equal(t, nil, err)
assert.Equal(t, len("deploys.test.myservice:2|c"), n)

n, err = conn.Write([]byte("deploys.test.my:service:2|c"))

n, err = conn.Write([]byte("deploys.test.myservice:1|c"))
assert.Equal(t, nil, err)
assert.Equal(t, len("deploys.test.myservice:1|c"), n)
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const VERSION = "0.7"
const VERSION = "0.8-alpha"

0 comments on commit b8e9317

Please sign in to comment.