mirror of
https://github.com/xtaci/kcptun.git
synced 2024-04-21 12:32:32 +00:00
fix closing scheme
This commit is contained in:
+2
-1
@@ -71,10 +71,11 @@ func handleClient(mux generic.Mux, p1 net.Conn, ctrl *generic.CopyControl, quiet
|
||||
}
|
||||
}
|
||||
}
|
||||
p1.Close()
|
||||
p2.Close()
|
||||
}
|
||||
|
||||
go streamCopy(p1, p2)
|
||||
// errors reading from p1(net.Conn) can close p2 while return
|
||||
streamCopy(p2, p1)
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -138,10 +138,11 @@ func handleClient(p1 io.ReadWriteCloser, p2 net.Conn, ctrl *generic.CopyControl,
|
||||
}
|
||||
}
|
||||
}
|
||||
p1.Close()
|
||||
p2.Close()
|
||||
}
|
||||
|
||||
go streamCopy(p2, p1)
|
||||
// errors reading from p2(net.Conn) can close p1 while return
|
||||
streamCopy(p1, p2)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user