mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-11 15:41:59 +08:00
优化性能
This commit is contained in:
@@ -34,7 +34,19 @@ func getLocalIPAddr() (ipAddr string, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func spliceSessionKey(srcIP string, srcPort int) (sessionKey string) {
|
||||
sessionKey = fmt.Sprintf("%s:%d", srcIP, srcPort)
|
||||
return
|
||||
func spliceSessionKey(srcIP *string, srcPort int) (*string) {
|
||||
// var buf strings.Builder
|
||||
// _, err := fmt.Fprint(&buf, *srcIP, ":", srcPort)
|
||||
// if err != nil {
|
||||
// panic(err.Error())
|
||||
// }
|
||||
// sessionKey := buf.String()
|
||||
|
||||
// buf := new(bytes.Buffer)
|
||||
// _ = templateSessionKey.ExecuteTemplate(buf, "IP", srcIP)
|
||||
// _ = templateSessionKey.ExecuteTemplate(buf, "Port", srcPort)
|
||||
// sessionKey := buf.String()
|
||||
|
||||
sessionKey := fmt.Sprintf("%s:%d", *srcIP, srcPort)
|
||||
return &sessionKey
|
||||
}
|
||||
|
Reference in New Issue
Block a user