mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
pool: added a function to init bufPools
This commit is contained in:
1 parent
0b0611a0dc
commit
b74880ae7a
5 files changed
+26
-30
No files matched your search
+2
-1
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user