Commit 30082adb authored by Jeromy's avatar Jeromy

update to utp code from master of go-ipfs

parent 3b01cc27
......@@ -18,8 +18,8 @@ var log = logging.Logger("github.com/ipfs/go-libp2p/p2p/net/swarm/addr")
var SupportedTransportStrings = []string{
"/ip4/tcp",
"/ip6/tcp",
// "/ip4/udp/utp", disabled because the lib is broken
// "/ip6/udp/utp", disabled because the lib is broken
"/ip4/udp/utp",
"/ip6/udp/utp",
// "/ip4/udp/udt", disabled because the lib doesnt work on arm
// "/ip6/udp/udt", disabled because the lib doesnt work on arm
}
......
......@@ -20,7 +20,6 @@ func TestFilterAddrs(t *testing.T) {
bad := []ma.Multiaddr{
newMultiaddr(t, "/ip4/1.2.3.4/udp/1234"), // unreliable
newMultiaddr(t, "/ip4/1.2.3.4/udp/1234/sctp/1234"), // not in manet
newMultiaddr(t, "/ip4/1.2.3.4/udp/1234/utp"), // utp is broken
newMultiaddr(t, "/ip4/1.2.3.4/udp/1234/udt"), // udt is broken on arm
newMultiaddr(t, "/ip6/fe80::1/tcp/1234"), // link local
newMultiaddr(t, "/ip6/fe80::100/tcp/1234"), // link local
......@@ -29,6 +28,7 @@ func TestFilterAddrs(t *testing.T) {
good := []ma.Multiaddr{
newMultiaddr(t, "/ip4/127.0.0.1/tcp/1234"),
newMultiaddr(t, "/ip6/::1/tcp/1234"),
newMultiaddr(t, "/ip4/1.2.3.4/udp/1234/utp"),
}
goodAndBad := append(good, bad...)
......@@ -39,18 +39,12 @@ func TestFilterAddrs(t *testing.T) {
if AddrUsable(a, false) {
t.Errorf("addr %s should be unusable", a)
}
if AddrUsable(a, true) {
t.Errorf("addr %s should be unusable", a)
}
}
for _, a := range good {
if !AddrUsable(a, false) {
t.Errorf("addr %s should be usable", a)
}
if !AddrUsable(a, true) {
t.Errorf("addr %s should be usable", a)
}
}
subtestAddrsEqual(t, FilterUsableAddrs(bad), []ma.Multiaddr{})
......
......@@ -151,7 +151,7 @@ func TestDialWait(t *testing.T) {
func TestDialBackoff(t *testing.T) {
// t.Skip("skipping for another test")
if ci.IsRunning() {
t.Skip("travis and jenkins will never have fun with this test")
t.Skip("travis will never have fun with this test")
}
t.Parallel()
......
......@@ -25,7 +25,6 @@ func TestFilterAddrs(t *testing.T) {
bad := []ma.Multiaddr{
m("/ip4/1.2.3.4/udp/1234"), // unreliable
m("/ip4/1.2.3.4/udp/1234/sctp/1234"), // not in manet
m("/ip4/1.2.3.4/udp/1234/utp"), // utp is broken
m("/ip4/1.2.3.4/udp/1234/udt"), // udt is broken on arm
m("/ip6/fe80::1/tcp/0"), // link local
m("/ip6/fe80::100/tcp/1234"), // link local
......@@ -34,6 +33,7 @@ func TestFilterAddrs(t *testing.T) {
good := []ma.Multiaddr{
m("/ip4/127.0.0.1/tcp/0"),
m("/ip6/::1/tcp/0"),
m("/ip4/1.2.3.4/udp/1234/utp"),
}
goodAndBad := append(good, bad...)
......@@ -41,13 +41,13 @@ func TestFilterAddrs(t *testing.T) {
// test filters
for _, a := range bad {
if addrutil.AddrUsable(a, true) {
if addrutil.AddrUsable(a, false) {
t.Errorf("addr %s should be unusable", a)
}
}
for _, a := range good {
if !addrutil.AddrUsable(a, true) {
if !addrutil.AddrUsable(a, false) {
t.Errorf("addr %s should be usable", a)
}
}
......
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