Skip to content

Commit

Permalink
buffer the error channel when handshaking
Browse files Browse the repository at this point in the history
Just in case the read panics. (addresses @whyrusleeping CR)
  • Loading branch information
Stebalien committed Aug 31, 2018
1 parent cabb0cc commit 1f1b091
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func SelectOneOf(protos []string, rwc io.ReadWriteCloser) (string, error) {
}

func handshake(rwc io.ReadWriteCloser) error {
errCh := make(chan error)
errCh := make(chan error, 1)
go func() {
errCh <- delimWriteBuffered(rwc, []byte(ProtocolID))
}()
Expand Down

0 comments on commit 1f1b091

Please sign in to comment.