Skip to content

Commit

Permalink
Merge pull request berty#2948 from moul/dev/moul/bump-deps589
Browse files Browse the repository at this point in the history
  • Loading branch information
moul authored Dec 25, 2020
2 parents 6bba38b + 413db33 commit cfa416a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 29 deletions.
17 changes: 8 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.14
require (
bazil.org/fuse v0.0.0-20200524192727-fb710f7dfd05 // indirect
berty.tech/go-ipfs-log v1.2.6
berty.tech/go-libp2p-tor-transport v0.8.3
berty.tech/go-libp2p-tor-transport v0.8.4
berty.tech/go-orbit-db v1.10.11
berty.tech/ipfs-webui-packed v1.0.0-v2.11.4-1
github.com/Masterminds/goutils v1.1.0 // indirect
Expand All @@ -17,7 +17,7 @@ require (
github.com/btcsuite/btcd v0.21.0-beta // indirect
github.com/buicongtan1997/protoc-gen-swagger-config v0.0.0-20190801162412-b6396e884596
github.com/campoy/embedmd v1.0.0
github.com/daixiang0/gci v0.2.4
github.com/daixiang0/gci v0.2.7
github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect
github.com/denisbrodbeck/machineid v1.0.1
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
Expand Down Expand Up @@ -54,19 +54,18 @@ require (
github.com/kisielk/errcheck v1.4.0 // indirect
github.com/koron/go-ssdp v0.0.2 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-libp2p v0.12.0
github.com/libp2p/go-libp2p v0.13.0
github.com/libp2p/go-libp2p-circuit v0.4.0
github.com/libp2p/go-libp2p-core v0.7.0
github.com/libp2p/go-libp2p-core v0.8.0
github.com/libp2p/go-libp2p-discovery v0.5.0
github.com/libp2p/go-libp2p-kad-dht v0.11.1
github.com/libp2p/go-libp2p-noise v0.1.2 // indirect
github.com/libp2p/go-libp2p-pubsub v0.4.0
github.com/libp2p/go-libp2p-quic-transport v0.9.3
github.com/libp2p/go-libp2p-quic-transport v0.10.0
github.com/libp2p/go-libp2p-record v0.1.3
github.com/libp2p/go-libp2p-rendezvous v0.0.0-20180418151804-b7dd840ce441
github.com/libp2p/go-libp2p-transport-upgrader v0.3.0
github.com/libp2p/go-libp2p-transport-upgrader v0.4.0
github.com/libp2p/go-netroute v0.1.4 // indirect
github.com/libp2p/go-yamux v1.4.1 // indirect
github.com/markbates/pkger v0.17.1
github.com/mattn/go-sqlite3 v1.14.5
github.com/mdomke/git-semver/v5 v5.0.0
Expand Down Expand Up @@ -105,7 +104,7 @@ require (
golang.org/x/mobile v0.0.0-20200801112145-973feb4309de
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
golang.org/x/text v0.3.4 // indirect
golang.org/x/tools v0.0.0-20201030010431-2feb2bb1ff51
golang.org/x/tools v0.0.0-20201118003311-bd56c0adb394
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
google.golang.org/genproto v0.0.0-20201022181438-0ff5f38871d5 // indirect
google.golang.org/grpc v1.34.0
Expand All @@ -130,7 +129,7 @@ replace (
github.com/agl/ed25519 => github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // latest commit before the author shutdown the repo; see https://github.com/golang/go/issues/20504
github.com/ipfs/go-ipfs => github.com/Jorropo/go-ipfs v0.4.20-0.20201127133049-9632069f4448 // temporary, see https://github.com/ipfs/go-ipfs/issues/7791
github.com/libp2p/go-libp2p-rendezvous => github.com/berty/go-libp2p-rendezvous v0.0.0-20201028141428-5b2e7e8ff19a // use berty fork of go-libp2p-rendezvous
github.com/libp2p/go-libp2p-swarm => github.com/Jorropo/go-libp2p-swarm v0.3.4 // temporary, see https://github.com/libp2p/go-libp2p-swarm/pull/227
github.com/libp2p/go-libp2p-swarm => github.com/Jorropo/go-libp2p-swarm v0.4.2 // temporary, see https://github.com/libp2p/go-libp2p-swarm/pull/227
github.com/peterbourgon/ff/v3 => github.com/moul/ff/v3 v3.0.1 // temporary, see https://github.com/peterbourgon/ff/pull/67, https://github.com/peterbourgon/ff/issues/68
golang.org/x/mobile => github.com/aeddi/mobile v0.0.1 // temporary, see https://github.com/golang/mobile/pull/58
)
47 changes: 34 additions & 13 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions go/internal/ipfsutil/localrecord.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type LocalRecord struct {
}

// OptionLocalRecord is given to CoreAPIOption.Options when the ipfs node setup
func OptionLocalRecord(ctx context.Context, node *ipfs_core.IpfsNode, api ipfs_interface.CoreAPI) error {
func OptionLocalRecord(node *ipfs_core.IpfsNode, api ipfs_interface.CoreAPI) error {
lr := &LocalRecord{
host: node.PeerHost,
}
Expand All @@ -41,9 +41,10 @@ func (lr *LocalRecord) ListenClose(network.Network, ma.Multiaddr) {}

// called when a connection opened
func (lr *LocalRecord) Connected(net network.Network, c network.Conn) {
ctx := context.Background() // FIXME: since [email protected] adds support for passed context on new call, we should think if we have a better context to pass here
go func() {
if manet.IsPrivateAddr(c.RemoteMultiaddr()) || mafmt.Base(mc.ProtocolCode).Matches(c.RemoteMultiaddr()) {
if err := lr.sendLocalRecord(c); err != nil {
if err := lr.sendLocalRecord(ctx, c); err != nil {
return
}
}
Expand All @@ -59,8 +60,8 @@ func (lr *LocalRecord) OpenedStream(network.Network, network.Stream) {}
// called when a stream closed
func (lr *LocalRecord) ClosedStream(network.Network, network.Stream) {}

func (lr *LocalRecord) sendLocalRecord(c network.Conn) error {
s, err := c.NewStream()
func (lr *LocalRecord) sendLocalRecord(ctx context.Context, c network.Conn) error {
s, err := c.NewStream(ctx)
if err != nil {
return err
}
Expand Down
Loading

0 comments on commit cfa416a

Please sign in to comment.