Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/kubo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c8cb8d9c39ef
Choose a base ref
...
head repository: ipfs/kubo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0d1072a80b30
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on May 22, 2015

  1. Copy the full SHA
    a3356b0 View commit details
  2. Merge pull request #1281 from ipfs/fix/bs-race

    fix minor data race in bitswap
    jbenet committed May 22, 2015
    Copy the full SHA
    0d1072a View commit details
Showing with 3 additions and 1 deletion.
  1. +3 −1 exchange/bitswap/bitswap.go
4 changes: 3 additions & 1 deletion exchange/bitswap/bitswap.go
Original file line number Diff line number Diff line change
@@ -287,8 +287,10 @@ func (bs *Bitswap) ReceiveMessage(ctx context.Context, p peer.ID, incoming bsmsg
if has, err := bs.blockstore.Has(block.Key()); err == nil && has {
bs.dupBlocksRecvd++
}
brecvd := bs.blocksRecvd
bdup := bs.dupBlocksRecvd
bs.counterLk.Unlock()
log.Infof("got block %s from %s (%d,%d)", block, p, bs.blocksRecvd, bs.dupBlocksRecvd)
log.Infof("got block %s from %s (%d,%d)", block, p, brecvd, bdup)

hasBlockCtx, cancel := context.WithTimeout(ctx, hasBlockTimeout)
if err := bs.HasBlock(hasBlockCtx, block); err != nil {