Skip to content

Commit

Permalink
Make sure recvFunc is called before responding on the recvChan
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Aug 10, 2013
1 parent baf3580 commit c4c0b85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zk/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -518,10 +518,10 @@ func (c *Conn) recvLoop(conn net.Conn) error {
} else {
_, err = decodePacket(buf[16:16+blen], req.recvStruct)
}
req.recvChan <- response{res.Zxid, err}
if req.recvFunc != nil {
req.recvFunc(req, &res, err)
}
req.recvChan <- response{res.Zxid, err}
if req.opcode == opClose {
return io.EOF
}
Expand Down

0 comments on commit c4c0b85

Please sign in to comment.