Skip to content

Commit 6735c97

Browse files
committed
fix: shutdown connection on handshake protocol error
Fixes #483
1 parent 0e93e28 commit 6735c97

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

connection.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ func (c *Connection) setupConnection() error {
325325
// Return an error if we're shutting down
326326
return io.EOF
327327
case err := <-c.protoErrorChan:
328+
// Shutdown the connection and return the error
329+
c.Close()
328330
return err
329331
case <-c.handshakeFinishedChan:
330332
// This is purposely empty, but we need this case to break out when this channel is closed

0 commit comments

Comments
 (0)