general: optimize code

This commit is contained in:
nadoo committed 2019-09-07 20:25:00 +08:00
1 parent 69bbaa809c
commit d36b8fa394
12 files changed
+65 -59

No files matched your search

+1 -1
View File
@@ -30,7 +30,7 @@ func NewPktConn(c net.PacketConn, writeAddr net.Addr, tgtAddr socks.Addr, tgtHea
if ctrlConn != nil {
go func() {
buf := []byte{}
buf := make([]byte, 1)
for {
_, err := ctrlConn.Read(buf)
if err, ok := err.(net.Error); ok && err.Timeout() {