Commit 35a49fbf authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub

Merge pull request #6 from libp2p/feat/better-dial-logs

log addr with failures
parents 6cce396b 7eca7c69
...@@ -12,6 +12,7 @@ import ( ...@@ -12,6 +12,7 @@ import (
type dialResult struct { type dialResult struct {
Conn iconn.Conn Conn iconn.Conn
Addr ma.Multiaddr
Err error Err error
} }
...@@ -141,7 +142,7 @@ func (dl *dialLimiter) executeDial(j *dialJob) { ...@@ -141,7 +142,7 @@ func (dl *dialLimiter) executeDial(j *dialJob) {
con, err := dl.dialFunc(j.ctx, j.peer, j.addr) con, err := dl.dialFunc(j.ctx, j.peer, j.addr)
select { select {
case j.resp <- dialResult{Conn: con, Err: err}: case j.resp <- dialResult{Conn: con, Addr: j.addr, Err: err}:
case <-j.ctx.Done(): case <-j.ctx.Done():
} }
} }
...@@ -318,7 +318,7 @@ func (s *Swarm) dialAddrs(ctx context.Context, p peer.ID, remoteAddrs <-chan ma. ...@@ -318,7 +318,7 @@ func (s *Swarm) dialAddrs(ctx context.Context, p peer.ID, remoteAddrs <-chan ma.
case resp := <-respch: case resp := <-respch:
active-- active--
if resp.Err != nil { if resp.Err != nil {
log.Info("got error on dial: ", resp.Err) log.Info("got error on dial to %s: ", resp.Addr, resp.Err)
// Errors are normal, lots of dials will fail // Errors are normal, lots of dials will fail
exitErr = resp.Err exitErr = resp.Err
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment