Add pool support everywhere

This commit is contained in:
9seconds
2020-03-24 11:22:59 +03:00
parent 9125a29e79
commit 837d96dc43
13 changed files with 162 additions and 62 deletions
+6 -1
View File
@@ -63,7 +63,12 @@ func (c *ClientProtocol) tlsHandshake(conn io.ReadWriter) error {
return fmt.Errorf("cannot read initial record: %w", err)
}
clientHello, err := tlstypes.ParseClientHello(helloRecord.Data.Bytes())
buf := acquireBytesBuffer()
defer releaseBytesBuffer(buf)
helloRecord.Data.WriteBytes(buf)
clientHello, err := tlstypes.ParseClientHello(buf.Bytes())
if err != nil {
return fmt.Errorf("cannot parse client hello: %w", err)
}