Skip to content

Commit

Permalink
Fix ip bytes conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
gunlee01 committed Jan 29, 2021
1 parent cc68b76 commit a9fecb8
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scouterx/common/util/iputil.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func IpToBytes(ip string) []byte {
return emptyIp
}
for i, part := range split {
v, err := strconv.ParseInt(part, 10, 8)
v, err := strconv.ParseUint(part, 10, 8)
if (err != nil || v < 0) {
return emptyIp
}
Expand Down
13 changes: 13 additions & 0 deletions scouterx/common/util/iputil_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package util

import (
"testing"

"fmt"
)

func TestIpToBytes(t *testing.T) {

bytes := IpToBytes("118.241.190.59")
fmt.Printf("bytes : %s \n",string(bytes))
}
1 change: 1 addition & 0 deletions scouterx/netio/dataproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func ResetTextSent() {
loginSent.Clear()
descSent.Clear()
stackElementSent.Clear()
hashMessageSent.Clear()
}
func reportScouterPanicFinal() {
if r := recover(); r != nil {
Expand Down
2 changes: 1 addition & 1 deletion scouterx/netio/tcpclient/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func handle(cmd string, pack netdata.Pack, in *netdata.DataInputX, out *netdata.
return GetGoroutineDetail(pack)
default:
if ac.IsTrace() {
logger.Trace.Println("UNKNWON-HANDLER: " + cmd)
logger.Trace.Println("UNKNOWN-HANDLER: " + cmd)
}
}

Expand Down

0 comments on commit a9fecb8

Please sign in to comment.