Skip to content

Commit

Permalink
Close the connection on auth failure
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed Aug 13, 2013
1 parent c4c0b85 commit 8d3e731
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zk/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,12 @@ func (c *Conn) loop() {
for {
c.connect()
err := c.authenticate()
if err == ErrSessionExpired {
switch {
case err == ErrSessionExpired:
c.invalidateWatches(err)
} else if err == nil {
case err != nil && c.conn != nil:
c.conn.Close()
case err == nil:
closeChan := make(chan bool) // channel to tell send loop stop
var wg sync.WaitGroup

Expand Down

0 comments on commit 8d3e731

Please sign in to comment.