Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

bug fix #456

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/shadowsocks-server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func handleConnection(conn *ss.Conn) {
debug.Printf("closed pipe %s<->%s\n", conn.RemoteAddr(), host)
}
connCnt--
if !closed {
if closed {
conn.Close()
}
}()
Expand All @@ -142,10 +142,11 @@ func handleConnection(conn *ss.Conn) {
} else {
log.Println("error connecting to:", host, err)
}
closed = true
return
}
defer func() {
if !closed {
if closed {
remote.Close()
}
}()
Expand All @@ -154,7 +155,6 @@ func handleConnection(conn *ss.Conn) {
}
go ss.PipeThenClose(conn, remote)
ss.PipeThenClose(remote, conn)
closed = true
return
}

Expand Down