Skip to content

Commit 5c4f70f

Browse files
authored
Merge pull request #484 from blinklabs-io/fix/handshake-error-shutdown
fix: shutdown connection on handshake protocol error
2 parents 0e93e28 + 6735c97 commit 5c4f70f

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)