Skip to content

Commit

Permalink
Add WithMaxConnBufferSize option for non-standard znode size (samuel#179
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mkaczanowski authored and samuel committed Oct 27, 2017
1 parent e6b59f6 commit 9a96098
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions zk/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,16 @@ func WithMaxBufferSize(maxBufferSize int) connOption {
}
}

// WithMaxConnBufferSize sets maximum buffer size used to send and encode
// packets to Zookeeper server. The standard Zookeepeer client for java defaults
// to a limit of 1mb. This option should be used for non-standard server setup
// where znode is bigger than default 1mb.
func WithMaxConnBufferSize(maxBufferSize int) connOption {
return func(c *Conn) {
c.buf = make([]byte, maxBufferSize)
}
}

func (c *Conn) Close() {
close(c.shouldQuit)

Expand Down

0 comments on commit 9a96098

Please sign in to comment.