diff options
Diffstat (limited to 'swarm/network/stream/delivery.go')
-rw-r--r-- | swarm/network/stream/delivery.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/swarm/network/stream/delivery.go b/swarm/network/stream/delivery.go index 02c5f222c..01ae7f943 100644 --- a/swarm/network/stream/delivery.go +++ b/swarm/network/stream/delivery.go @@ -29,6 +29,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/storage" "github.com/ethereum/go-ethereum/swarm/tracing" opentracing "github.com/opentracing/opentracing-go" + olog "github.com/opentracing/opentracing-go/log" ) const ( @@ -146,6 +147,8 @@ func (d *Delivery) handleRetrieveRequestMsg(ctx context.Context, sp *Peer, req * ctx, "stream.handle.retrieve") + osp.LogFields(olog.String("ref", req.Addr.String())) + s, err := sp.getServer(NewStream(swarmChunkServerStreamName, "", true)) if err != nil { return err @@ -176,12 +179,15 @@ func (d *Delivery) handleRetrieveRequestMsg(ctx context.Context, sp *Peer, req * } if req.SkipCheck { syncing := false + osp.LogFields(olog.Bool("skipCheck", true)) + err = sp.Deliver(ctx, chunk, s.priority, syncing) if err != nil { log.Warn("ERROR in handleRetrieveRequestMsg", "err", err) } return } + osp.LogFields(olog.Bool("skipCheck", false)) select { case streamer.deliveryC <- chunk.Address()[:]: case <-streamer.quit: @@ -219,7 +225,8 @@ func (d *Delivery) handleChunkDeliveryMsg(ctx context.Context, sp *Peer, req *Ch go func() { if span != nil { - defer span.(opentracing.Span).Finish() + span.LogFields(olog.String("finish", "from handleChunkDeliveryMsg")) + defer span.Finish() } req.peer = sp |