Android: patch
This commit is contained in:
25
tunnel/statistic/patch.go
Normal file
25
tunnel/statistic/patch.go
Normal file
@ -0,0 +1,25 @@
|
||||
package statistic
|
||||
|
||||
import (
|
||||
"net"
|
||||
)
|
||||
|
||||
func (m *Manager) Total() (up, down int64) {
|
||||
return m.uploadTotal.Load(), m.downloadTotal.Load()
|
||||
}
|
||||
|
||||
func (tt *tcpTracker) RawConn() (net.Conn, bool) {
|
||||
if tt.Chain.Last() == "DIRECT" {
|
||||
return tt.Conn, true
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
||||
|
||||
func (ut *udpTracker) RawPacketConn() (net.PacketConn, bool) {
|
||||
if ut.Chain.Last() == "DIRECT" {
|
||||
return ut.PacketConn, true
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
Reference in New Issue
Block a user