Skip to content

Commit

Permalink
Merge pull request #484 from blinklabs-io/fix/handshake-error-shutdown
Browse files Browse the repository at this point in the history
fix: shutdown connection on handshake protocol error
  • Loading branch information
agaffney authored Jan 30, 2024
2 parents 0e93e28 + 6735c97 commit 5c4f70f
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 5c4f70f

Please sign in to comment.