Skip to content

Commit d2399ec

Browse files
author
wardlin
committed
update
1 parent ec11c5a commit d2399ec

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

icmp.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func (t *TraceRoute) SendIPv4ICMP() error {
4545
t.SendChan <- report
4646
id = (id + 1) % mod
4747

48-
logrus.Info("send icmp ttl:", ttl)
48+
//logrus.Info("send icmp ttl:", ttl)
4949

5050
//atomic.AddUint64(db.SendCnt, 1)
5151
}
@@ -101,7 +101,7 @@ func (t *TraceRoute) ListenIPv4ICMP() error {
101101
RespAddr: raddr.String(),
102102
TimeStamp: time.Now(),
103103
}
104-
logrus.Info("recv icmp ttl:", id)
104+
//logrus.Info("recv icmp ttl:", id)
105105

106106
t.RecvChan <- m
107107
}

trace_test.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ import (
66
)
77

88
func TestTrace(t *testing.T) {
9-
c, err := New("icmp", "www.baidu.com", "", "ip4", 3, 3, 5)
9+
c, err := New("icmp", "www.qq.com", "", "ip4", 3, 3, 5)
1010
if err!=nil{
1111
t.Fatal(err)
1212
return
1313
}
1414

1515
//执行
16-
c.Run()
16+
if err := c.Run();err!=nil{
17+
t.Fatal(err)
18+
return
19+
}
1720

1821
//收集统计结果
1922
ret := c.Statistics()

0 commit comments

Comments
 (0)