Browse Source

cleanup

pull/15/head
Jason 5 years ago
parent
commit
62380bd5ed
  1. 4
      common/stats/session/session.go
  2. 4
      proxy/socks/udp.go

4
common/stats/session/session.go

@ -128,7 +128,7 @@ func (s *simpleSessionStater) RemoveSession(key interface{}) {
s.completedSessions = s.completedSessions[1:]
}
s.mux.Unlock()
// delete
s.sessions.Delete(key)
}
// delete
s.sessions.Delete(key)
}

4
proxy/socks/udp.go

@ -236,8 +236,6 @@ func (h *udpHandler) ReceiveTo(conn core.UDPConn, data []byte, addr *net.UDPAddr
}
func (h *udpHandler) Close(conn core.UDPConn) {
conn.Close()
h.Lock()
defer h.Unlock()
@ -249,6 +247,8 @@ func (h *udpHandler) Close(conn core.UDPConn) {
remoteUDPConn.Close()
delete(h.udpConns, conn)
}
conn.Close()
delete(h.remoteAddrs, conn)
if h.sessionStater != nil {

Loading…
Cancel
Save