File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ func proxyToServer(client *Client, serverAddr string) {
21
21
eConn := utils .NewEncryptedConn (remoteConn , client .Password )
22
22
// remoteConn, err := net.Dial("tcp", "localhost:8112")
23
23
24
- defer eConn .Conn . Close ()
24
+ defer eConn .Close ()
25
25
26
26
go utils .Copy (eConn , client .Conn )
27
27
utils .Copy (client .Conn , eConn )
@@ -44,7 +44,6 @@ func handleClient(client *Client, serverAddr string) {
44
44
}
45
45
46
46
method := chooseAuthMethod (methods )
47
-
48
47
err = client .SetAuthMethod (method )
49
48
50
49
if err != nil {
Original file line number Diff line number Diff line change 7
7
)
8
8
9
9
func handleConn (eConn * utils.EncryptedConn ) {
10
+ defer eConn .Close ()
11
+
10
12
buf := utils .Pool33K .Get ()
11
13
defer utils .Pool33K .Put (buf )
12
14
Original file line number Diff line number Diff line change @@ -6,8 +6,10 @@ import (
6
6
"time"
7
7
)
8
8
9
- // this code is copy from https://golang.org/src/io/io.go
10
- // add timeout and buffer pool support
9
+ // this code is copied from https://golang.org/src/io/io.go
10
+ // with some additions
11
+ // 1. timeout
12
+ // 2. buffer pool
11
13
12
14
func Copy (dst net.Conn , src net.Conn ) (written int64 , err error ) {
13
15
timeoutDuration := 15 * time .Second
You can’t perform that action at this time.
0 commit comments