mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
general: optimize code
This commit is contained in:
1 parent
69bbaa809c
commit
d36b8fa394
12 files changed
+65
-59
No files matched your search
@@ -9,6 +9,7 @@
|
||||
// socks5 server:
|
||||
// https://github.com/shadowsocks/go-shadowsocks2/tree/master/socks
|
||||
|
||||
// Package socks5 implements a socks5 proxy.
|
||||
package socks5
|
||||
|
||||
import (
|
||||
@@ -114,7 +115,7 @@ func (s *SOCKS5) Serve(c net.Conn) {
|
||||
if err != nil {
|
||||
// UDP: keep the connection until disconnect then free the UDP socket
|
||||
if err == socks.Errors[9] {
|
||||
buf := []byte{}
|
||||
buf := make([]byte, 1)
|
||||
// block here
|
||||
for {
|
||||
_, err := c.Read(buf)
|
||||
|
||||
Reference in new issue
Block a user