fix: 修复使用 -f 导致打印卡住的问题

This commit is contained in:
Leo
2023-01-18 13:19:27 +08:00
parent a73a306d0a
commit b8542489b6
2 changed files with 2 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ type ICMPTracer struct {
func (t *ICMPTracer) PrintFunc() {
defer t.wg.Done()
var ttl = 0
var ttl = t.Config.BeginHop - 1
for {
if t.AsyncPrinter != nil {
t.AsyncPrinter(&t.res)

View File

@@ -29,7 +29,7 @@ type ICMPTracerv6 struct {
func (t *ICMPTracerv6) PrintFunc() {
// defer t.wg.Done()
var ttl = 0
var ttl = t.Config.BeginHop - 1
for {
if t.RealtimePrinter != nil {
// 接收的时候检查一下是不是 3 跳都齐了