Skip to content

Commit

Permalink
fix: shutdown connection on handshake protocol error
Browse files Browse the repository at this point in the history
Fixes #483
  • Loading branch information
agaffney committed Jan 30, 2024
1 parent 0e93e28 commit 6735c97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ func (c *Connection) setupConnection() error {
// Return an error if we're shutting down
return io.EOF
case err := <-c.protoErrorChan:
// Shutdown the connection and return the error
c.Close()
return err
case <-c.handshakeFinishedChan:
// This is purposely empty, but we need this case to break out when this channel is closed
Expand Down

0 comments on commit 6735c97

Please sign in to comment.