Skip to content

Commit a9fecb8

Browse files
committed
Fix ip bytes conversion
1 parent cc68b76 commit a9fecb8

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

scouterx/common/util/iputil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func IpToBytes(ip string) []byte {
1414
return emptyIp
1515
}
1616
for i, part := range split {
17-
v, err := strconv.ParseInt(part, 10, 8)
17+
v, err := strconv.ParseUint(part, 10, 8)
1818
if (err != nil || v < 0) {
1919
return emptyIp
2020
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package util
2+
3+
import (
4+
"testing"
5+
6+
"fmt"
7+
)
8+
9+
func TestIpToBytes(t *testing.T) {
10+
11+
bytes := IpToBytes("118.241.190.59")
12+
fmt.Printf("bytes : %s \n",string(bytes))
13+
}

scouterx/netio/dataproxy.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func ResetTextSent() {
3636
loginSent.Clear()
3737
descSent.Clear()
3838
stackElementSent.Clear()
39+
hashMessageSent.Clear()
3940
}
4041
func reportScouterPanicFinal() {
4142
if r := recover(); r != nil {

scouterx/netio/tcpclient/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func handle(cmd string, pack netdata.Pack, in *netdata.DataInputX, out *netdata.
148148
return GetGoroutineDetail(pack)
149149
default:
150150
if ac.IsTrace() {
151-
logger.Trace.Println("UNKNWON-HANDLER: " + cmd)
151+
logger.Trace.Println("UNKNOWN-HANDLER: " + cmd)
152152
}
153153
}
154154

0 commit comments

Comments
 (0)