Commit 14aac9bb authored by Jeromy Johnson's avatar Jeromy Johnson Committed by GitHub
Browse files

Merge pull request #84 from libp2p/feat/update-multistream

update multistream deps and fix code to work with new changes
parents 5b9cd671 dd707e22
...@@ -6,9 +6,9 @@ import ( ...@@ -6,9 +6,9 @@ import (
ic "github.com/ipfs/go-libp2p-crypto" ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
inet "github.com/ipfs/go-libp2p/p2p/net"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
process "github.com/jbenet/goprocess" process "github.com/jbenet/goprocess"
inet "github.com/libp2p/go-libp2p/p2p/net"
) )
// conn represents one side's perspective of a // conn represents one side's perspective of a
......
...@@ -7,7 +7,7 @@ import ( ...@@ -7,7 +7,7 @@ import (
"time" "time"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
inet "github.com/ipfs/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p/p2p/net"
) )
// link implements mocknet.Link // link implements mocknet.Link
......
...@@ -5,11 +5,11 @@ import ( ...@@ -5,11 +5,11 @@ import (
"sort" "sort"
"sync" "sync"
host "github.com/ipfs/go-libp2p/p2p/host" host "github.com/libp2p/go-libp2p/p2p/host"
bhost "github.com/ipfs/go-libp2p/p2p/host/basic" bhost "github.com/libp2p/go-libp2p/p2p/host/basic"
inet "github.com/ipfs/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p/p2p/net"
p2putil "github.com/ipfs/go-libp2p/p2p/test/util" p2putil "github.com/libp2p/go-libp2p/p2p/test/util"
testutil "github.com/ipfs/go-libp2p/testutil" testutil "github.com/libp2p/go-libp2p/testutil"
ic "github.com/ipfs/go-libp2p-crypto" ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
......
...@@ -5,8 +5,8 @@ import ( ...@@ -5,8 +5,8 @@ import (
"time" "time"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
inet "github.com/ipfs/go-libp2p/p2p/net"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
inet "github.com/libp2p/go-libp2p/p2p/net"
context "golang.org/x/net/context" context "golang.org/x/net/context"
) )
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"math/rand" "math/rand"
"sync" "sync"
inet "github.com/ipfs/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p/p2p/net"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
......
...@@ -5,7 +5,7 @@ import ( ...@@ -5,7 +5,7 @@ import (
"io" "io"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
inet "github.com/ipfs/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p/p2p/net"
) )
// separate object so our interfaces are separate :) // separate object so our interfaces are separate :)
......
...@@ -5,8 +5,8 @@ import ( ...@@ -5,8 +5,8 @@ import (
"io" "io"
"time" "time"
inet "github.com/ipfs/go-libp2p/p2p/net"
process "github.com/jbenet/goprocess" process "github.com/jbenet/goprocess"
inet "github.com/libp2p/go-libp2p/p2p/net"
) )
// stream implements inet.Stream // stream implements inet.Stream
...@@ -16,6 +16,8 @@ type stream struct { ...@@ -16,6 +16,8 @@ type stream struct {
conn *conn conn *conn
toDeliver chan *transportObject toDeliver chan *transportObject
proc process.Process proc process.Process
protocol string
} }
type transportObject struct { type transportObject struct {
...@@ -48,6 +50,14 @@ func (s *stream) Write(p []byte) (n int, err error) { ...@@ -48,6 +50,14 @@ func (s *stream) Write(p []byte) (n int, err error) {
return len(p), nil return len(p), nil
} }
func (s *stream) Protocol() string {
return s.protocol
}
func (s *stream) SetProtocol(proto string) {
s.protocol = proto
}
func (s *stream) Close() error { func (s *stream) Close() error {
return s.proc.Close() return s.proc.Close()
} }
......
...@@ -10,9 +10,9 @@ import ( ...@@ -10,9 +10,9 @@ import (
"time" "time"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
inet "github.com/ipfs/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p/p2p/net"
protocol "github.com/ipfs/go-libp2p/p2p/protocol" protocol "github.com/libp2p/go-libp2p/p2p/protocol"
testutil "github.com/ipfs/go-libp2p/testutil" testutil "github.com/libp2p/go-libp2p/testutil"
detectrace "github.com/jbenet/go-detect-race" detectrace "github.com/jbenet/go-detect-race"
context "golang.org/x/net/context" context "golang.org/x/net/context"
......
...@@ -9,7 +9,7 @@ import ( ...@@ -9,7 +9,7 @@ import (
context "golang.org/x/net/context" context "golang.org/x/net/context"
) )
var log = logging.Logger("github.com/ipfs/go-libp2p/p2p/net/swarm/addr") var log = logging.Logger("github.com/libp2p/go-libp2p/p2p/net/swarm/addr")
// SupportedTransportStrings is the list of supported transports for the swarm. // SupportedTransportStrings is the list of supported transports for the swarm.
// These are strings of encapsulated multiaddr protocols. E.g.: // These are strings of encapsulated multiaddr protocols. E.g.:
......
...@@ -6,9 +6,9 @@ import ( ...@@ -6,9 +6,9 @@ import (
"testing" "testing"
"time" "time"
addrutil "github.com/ipfs/go-libp2p/p2p/net/swarm/addr" addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
testutil "github.com/ipfs/go-libp2p/testutil" testutil "github.com/libp2p/go-libp2p/testutil"
ci "github.com/ipfs/go-libp2p/testutil/ci" ci "github.com/libp2p/go-libp2p/testutil/ci"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
......
...@@ -7,8 +7,8 @@ import ( ...@@ -7,8 +7,8 @@ import (
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
context "golang.org/x/net/context" context "golang.org/x/net/context"
conn "github.com/ipfs/go-libp2p/p2p/net/conn" conn "github.com/libp2p/go-libp2p/p2p/net/conn"
addrutil "github.com/ipfs/go-libp2p/p2p/net/swarm/addr" addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
) )
type dialResult struct { type dialResult struct {
......
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
mafmt "github.com/whyrusleeping/mafmt" mafmt "github.com/whyrusleeping/mafmt"
context "golang.org/x/net/context" context "golang.org/x/net/context"
conn "github.com/ipfs/go-libp2p/p2p/net/conn" conn "github.com/libp2p/go-libp2p/p2p/net/conn"
) )
func mustAddr(t *testing.T, s string) ma.Multiaddr { func mustAddr(t *testing.T, s string) ma.Multiaddr {
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
"testing" "testing"
"time" "time"
ci "github.com/ipfs/go-libp2p/testutil/ci" ci "github.com/libp2p/go-libp2p/testutil/ci"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
......
...@@ -13,18 +13,18 @@ import ( ...@@ -13,18 +13,18 @@ import (
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
transport "github.com/ipfs/go-libp2p-transport" transport "github.com/ipfs/go-libp2p-transport"
metrics "github.com/ipfs/go-libp2p/p2p/metrics"
mconn "github.com/ipfs/go-libp2p/p2p/metrics/conn"
inet "github.com/ipfs/go-libp2p/p2p/net"
conn "github.com/ipfs/go-libp2p/p2p/net/conn"
filter "github.com/ipfs/go-libp2p/p2p/net/filter"
addrutil "github.com/ipfs/go-libp2p/p2p/net/swarm/addr"
logging "github.com/ipfs/go-log" logging "github.com/ipfs/go-log"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
ps "github.com/jbenet/go-peerstream" ps "github.com/jbenet/go-peerstream"
pst "github.com/jbenet/go-stream-muxer" pst "github.com/jbenet/go-stream-muxer"
"github.com/jbenet/goprocess" "github.com/jbenet/goprocess"
goprocessctx "github.com/jbenet/goprocess/context" goprocessctx "github.com/jbenet/goprocess/context"
metrics "github.com/libp2p/go-libp2p/p2p/metrics"
mconn "github.com/libp2p/go-libp2p/p2p/metrics/conn"
inet "github.com/libp2p/go-libp2p/p2p/net"
conn "github.com/libp2p/go-libp2p/p2p/net/conn"
filter "github.com/libp2p/go-libp2p/p2p/net/filter"
addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
psmss "github.com/whyrusleeping/go-smux-multistream" psmss "github.com/whyrusleeping/go-smux-multistream"
spdy "github.com/whyrusleeping/go-smux-spdystream" spdy "github.com/whyrusleeping/go-smux-spdystream"
yamux "github.com/whyrusleeping/go-smux-yamux" yamux "github.com/whyrusleeping/go-smux-yamux"
...@@ -340,9 +340,9 @@ func (n *ps2netNotifee) Disconnected(c *ps.Conn) { ...@@ -340,9 +340,9 @@ func (n *ps2netNotifee) Disconnected(c *ps.Conn) {
} }
func (n *ps2netNotifee) OpenedStream(s *ps.Stream) { func (n *ps2netNotifee) OpenedStream(s *ps.Stream) {
n.not.OpenedStream(n.net, inet.Stream((*Stream)(s))) n.not.OpenedStream(n.net, &Stream{stream: s})
} }
func (n *ps2netNotifee) ClosedStream(s *ps.Stream) { func (n *ps2netNotifee) ClosedStream(s *ps.Stream) {
n.not.ClosedStream(n.net, inet.Stream((*Stream)(s))) n.not.ClosedStream(n.net, &Stream{stream: s})
} }
package swarm package swarm
import ( import (
conn "github.com/ipfs/go-libp2p/p2p/net/conn" conn "github.com/libp2p/go-libp2p/p2p/net/conn"
addrutil "github.com/ipfs/go-libp2p/p2p/net/swarm/addr" addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
) )
......
...@@ -3,9 +3,9 @@ package swarm ...@@ -3,9 +3,9 @@ package swarm
import ( import (
"testing" "testing"
metrics "github.com/ipfs/go-libp2p/p2p/metrics" metrics "github.com/libp2p/go-libp2p/p2p/metrics"
addrutil "github.com/ipfs/go-libp2p/p2p/net/swarm/addr" addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
testutil "github.com/ipfs/go-libp2p/testutil" testutil "github.com/libp2p/go-libp2p/testutil"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
......
...@@ -3,8 +3,8 @@ package swarm ...@@ -3,8 +3,8 @@ package swarm
import ( import (
"fmt" "fmt"
inet "github.com/ipfs/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p/p2p/net"
conn "github.com/ipfs/go-libp2p/p2p/net/conn" conn "github.com/libp2p/go-libp2p/p2p/net/conn"
ic "github.com/ipfs/go-libp2p-crypto" ic "github.com/ipfs/go-libp2p-crypto"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
......
...@@ -8,9 +8,9 @@ import ( ...@@ -8,9 +8,9 @@ import (
lgbl "github.com/ipfs/go-libp2p-loggables" lgbl "github.com/ipfs/go-libp2p-loggables"
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
conn "github.com/ipfs/go-libp2p/p2p/net/conn"
addrutil "github.com/ipfs/go-libp2p/p2p/net/swarm/addr"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
conn "github.com/libp2p/go-libp2p/p2p/net/conn"
addrutil "github.com/libp2p/go-libp2p/p2p/net/swarm/addr"
context "golang.org/x/net/context" context "golang.org/x/net/context"
) )
......
...@@ -5,11 +5,11 @@ import ( ...@@ -5,11 +5,11 @@ import (
lgbl "github.com/ipfs/go-libp2p-loggables" lgbl "github.com/ipfs/go-libp2p-loggables"
transport "github.com/ipfs/go-libp2p-transport" transport "github.com/ipfs/go-libp2p-transport"
mconn "github.com/ipfs/go-libp2p/p2p/metrics/conn"
inet "github.com/ipfs/go-libp2p/p2p/net"
conn "github.com/ipfs/go-libp2p/p2p/net/conn"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
ps "github.com/jbenet/go-peerstream" ps "github.com/jbenet/go-peerstream"
mconn "github.com/libp2p/go-libp2p/p2p/metrics/conn"
inet "github.com/libp2p/go-libp2p/p2p/net"
conn "github.com/libp2p/go-libp2p/p2p/net/conn"
context "golang.org/x/net/context" context "golang.org/x/net/context"
) )
......
...@@ -5,8 +5,8 @@ import ( ...@@ -5,8 +5,8 @@ import (
peer "github.com/ipfs/go-libp2p-peer" peer "github.com/ipfs/go-libp2p-peer"
pstore "github.com/ipfs/go-libp2p-peerstore" pstore "github.com/ipfs/go-libp2p-peerstore"
metrics "github.com/ipfs/go-libp2p/p2p/metrics" metrics "github.com/libp2p/go-libp2p/p2p/metrics"
inet "github.com/ipfs/go-libp2p/p2p/net" inet "github.com/libp2p/go-libp2p/p2p/net"
ma "github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-multiaddr"
"github.com/jbenet/goprocess" "github.com/jbenet/goprocess"
......
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