Skip to content

Commit

Permalink
add more debug logging of port mapping process
Browse files Browse the repository at this point in the history
  • Loading branch information
2color committed Jan 24, 2025
1 parent 1bd76eb commit 528b2b1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ require (
lukechampine.com/blake3 v1.3.0 // indirect
)

replace github.com/libp2p/go-libp2p => github.com/libp2p/go-libp2p v0.38.2-0.20250124031147-b2939f150c20
replace github.com/libp2p/go-libp2p => ../
1 change: 1 addition & 0 deletions p2p/host/basic/natmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func (nmgr *natManager) background(ctx context.Context) {

discoverCtx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
log.Info("DiscoverNAT start")
natInstance, err := discoverNAT(discoverCtx)
if err != nil {
log.Info("DiscoverNAT error:", err)
Expand Down
3 changes: 3 additions & 0 deletions p2p/net/nat/internal/nat/nat.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func discoverNATs(ctx context.Context) ([]NAT, []error) {
select {
case resCh <- natsAndErrs{nats, errs}:
case <-ctx.Done():
log.Debug("discoverUPNP_IG1 context done")
}
}()

Expand All @@ -83,6 +84,7 @@ func discoverNATs(ctx context.Context) ([]NAT, []error) {
select {
case resCh <- natsAndErrs{nats, errs}:
case <-ctx.Done():
log.Debug("discoverUPNP_IG2 context done")
}
}()

Expand All @@ -100,6 +102,7 @@ func discoverNATs(ctx context.Context) ([]NAT, []error) {
select {
case resCh <- natsAndErrs{nats, errs}:
case <-ctx.Done():
log.Debug("discoverNATPMP context done")
}
}()

Expand Down

0 comments on commit 528b2b1

Please sign in to comment.