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
+3 -2
View File
@@ -1,7 +1,6 @@
package stream
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/md5" // nolint: gosec
@@ -54,7 +53,9 @@ func mtprotoDeriveKeys(purpose mtprotoCipherPurpose,
resp *rpc.NonceResponse,
client, remote *net.TCPAddr,
secret []byte) ([]byte, []byte) {
message := bytes.Buffer{}
message := acquireBytesBuffer()
defer releaseBytesBuffer(message)
message.Write(resp.Nonce) // nolint: gosec
message.Write(req.Nonce) // nolint: gosec
message.Write(req.CryptoTS) // nolint: gosec