Closes the conn on bad protocol version.

pull/2259/head
James Phillips 2016-08-09 18:13:53 -07:00
parent a984a6703c
commit 406efb5d91
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
1 changed files with 1 additions and 0 deletions

View File

@ -282,6 +282,7 @@ func (p *ConnPool) getNewConn(dc string, addr net.Addr, version int) (*Conn, err
// Switch the multiplexing based on version
var session muxSession
if version < 2 {
conn.Close()
return nil, fmt.Errorf("cannot make client connection, unsupported protocol version %d", version)
} else {
// Write the Consul multiplex byte to set the mode