mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
pool: return specified size of buffer
This commit is contained in:
1 parent
5326c0a901
commit
a0542a028e
16 files changed
+158
-139
No files matched your search
@@ -4,7 +4,6 @@
|
||||
package trojan
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"crypto/tls"
|
||||
"encoding/hex"
|
||||
@@ -13,6 +12,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/nadoo/glider/common/log"
|
||||
"github.com/nadoo/glider/common/pool"
|
||||
"github.com/nadoo/glider/common/socks"
|
||||
"github.com/nadoo/glider/proxy"
|
||||
)
|
||||
@@ -105,7 +105,9 @@ func (s *Trojan) dial(network, addr string) (net.Conn, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var buf bytes.Buffer
|
||||
buf := pool.GetWriteBuffer()
|
||||
defer pool.PutWriteBuffer(buf)
|
||||
|
||||
buf.Write(s.pass[:])
|
||||
buf.WriteString("\r\n")
|
||||
|
||||
|
||||
Reference in new issue
Block a user