pool: added a function to init bufPools

This commit is contained in:
nadoo committed 2020-04-21 12:17:14 +08:00
1 parent 0b0611a0dc
commit b74880ae7a
5 files changed
+26 -30

No files matched your search

+2 -1
View File
@@ -118,7 +118,8 @@ func parseFirstLine(line string) (r1, r2, r3 string, ok bool) {
}
func generateClientKey() string {
p := make([]byte, 16)
p := pool.GetBuffer(16)
defer pool.PutBuffer(p)
rand.Read(p)
return base64.StdEncoding.EncodeToString(p)
}