优化数据统计

This commit is contained in:
刘祥超
2023-07-30 14:49:16 +08:00
parent eb145393ab
commit 45c6b2ddac
8 changed files with 61 additions and 8 deletions

View File

@@ -82,3 +82,18 @@ func (this *ClientTLSConn) Fingerprint() []byte {
}
return nil
}
// LastRequestBytes 读取上一次请求发送的字节数
func (this *ClientTLSConn) LastRequestBytes() int64 {
tlsConn, ok := this.rawConn.(*tls.Conn)
if ok {
var rawConn = tlsConn.NetConn()
if rawConn != nil {
clientConn, ok := rawConn.(*ClientConn)
if ok {
return clientConn.LastRequestBytes()
}
}
}
return 0
}