From 1f1b091155e94b2c5f630614a6372c635eb2f9a6 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 30 Aug 2018 18:38:12 -0700 Subject: [PATCH] buffer the error channel when handshaking Just in case the read panics. (addresses @whyrusleeping CR) --- client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client.go b/client.go index 435856e..8f41eb1 100644 --- a/client.go +++ b/client.go @@ -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)) }()