Skip to content

Commit

Permalink
Make all access to session ID atomic
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel committed May 31, 2016
1 parent 8b35c1c commit 474b879
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions zk/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (c *Conn) loop() {
c.logger.Printf("Authentication failed: %s", err)
c.conn.Close()
case err == nil:
c.logger.Printf("Authenticated: id=%d, timeout=%d", c.sessionID, c.sessionTimeoutMs)
c.logger.Printf("Authenticated: id=%d, timeout=%d", c.SessionID(), c.sessionTimeoutMs)
c.hostProvider.Connected() // mark success
closeChan := make(chan struct{}) // channel to tell send loop stop
var wg sync.WaitGroup
Expand Down Expand Up @@ -452,7 +452,7 @@ func (c *Conn) authenticate() error {
ProtocolVersion: protocolVersion,
LastZxidSeen: c.lastZxid,
TimeOut: c.sessionTimeoutMs,
SessionID: c.sessionID,
SessionID: c.SessionID(),
Passwd: c.passwd,
})
if err != nil {
Expand Down

0 comments on commit 474b879

Please sign in to comment.