Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
62af6522
Commit
62af6522
authored
Jan 30, 2016
by
Jeromy
Browse files
update to utp code from master of go-ipfs
parent
a24d8ba9
Changes
4
Hide whitespace changes
Inline
Side-by-side
p2p/net/swarm/addr/addr.go
View file @
62af6522
...
...
@@ -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
}
...
...
p2p/net/swarm/addr/addr_test.go
View file @
62af6522
...
...
@@ -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
{})
...
...
p2p/net/swarm/dial_test.go
View file @
62af6522
...
...
@@ -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
()
...
...
p2p/net/swarm/swarm_addr_test.go
View file @
62af6522
...
...
@@ -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
,
tru
e
)
{
if
addrutil
.
AddrUsable
(
a
,
fals
e
)
{
t
.
Errorf
(
"addr %s should be unusable"
,
a
)
}
}
for
_
,
a
:=
range
good
{
if
!
addrutil
.
AddrUsable
(
a
,
tru
e
)
{
if
!
addrutil
.
AddrUsable
(
a
,
fals
e
)
{
t
.
Errorf
(
"addr %s should be usable"
,
a
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment